| Index: tests/html/location_test.dart
|
| diff --git a/tests/html/location_test.dart b/tests/html/location_test.dart
|
| index e1f0fb8a6599505a9f771932c91178f69258a396..88e3f2d357d91a1a6d0b2206243d651f1d5e6186 100644
|
| --- a/tests/html/location_test.dart
|
| +++ b/tests/html/location_test.dart
|
| @@ -2,6 +2,7 @@ library LocationTest;
|
| import '../../pkg/unittest/lib/unittest.dart';
|
| import '../../pkg/unittest/lib/html_config.dart';
|
| import 'dart:html';
|
| +import 'dart:uri';
|
|
|
| main() {
|
| useHtmlConfiguration();
|
| @@ -17,4 +18,17 @@ main() {
|
| 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 = new Uri(window.location.href);
|
| + var reconstructedOrigin = '${uri.scheme}://${uri.domain}';
|
| + if (uri.port != 0) {
|
| + reconstructedOrigin = '$reconstructedOrigin:${uri.port}';
|
| + }
|
| +
|
| + expect(origin, reconstructedOrigin);
|
| + });
|
| }
|
|
|