60a966605d
This finishes going through the dev_compiler HTML tests and switches out unittest for minitest wherever possible. In the process, it gets another 10 tests strong mode clean, and gets several more passing, and more not skipped. With this CL, we're running another 50 more HTML tests (though some are expected to fail, mostly because of #27578). R=jacobr@google.com, vsm@google.com Review URL: https://codereview.chromium.org/2419863002 .
31 lines
790 B
Dart
31 lines
790 B
Dart
import 'dart:html';
|
|
|
|
import 'package:expect/minitest.dart';
|
|
|
|
main() {
|
|
var isLocation = predicate((x) => x is Location, 'is a Location');
|
|
|
|
test('location hash', () {
|
|
final location = window.location;
|
|
expect(location, isLocation);
|
|
|
|
// The only navigation we dare try is hash.
|
|
location.hash = 'hello';
|
|
var h = location.hash;
|
|
expect(h, '#hello');
|
|
});
|
|
|
|
test('location.origin', () {
|
|
var origin = window.location.origin;
|
|
|
|
// We build up the origin from Uri, then make sure that it matches.
|
|
var uri = Uri.parse(window.location.href);
|
|
var reconstructedOrigin = '${uri.scheme}://${uri.host}';
|
|
if (uri.port != 0) {
|
|
reconstructedOrigin = '$reconstructedOrigin:${uri.port}';
|
|
}
|
|
|
|
expect(origin, reconstructedOrigin);
|
|
});
|
|
}
|