Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Unified Diff: tests/html/location_test.dart

Issue 14646032: Fixing Location.origin to work on non-WebKit browsers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ });
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698