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

Unified Diff: pkg/unittest/lib/html_config.dart

Issue 11641005: Add cross-origin test with credentials. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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
Index: pkg/unittest/lib/html_config.dart
diff --git a/pkg/unittest/lib/html_config.dart b/pkg/unittest/lib/html_config.dart
index 3d87f98a77b9ea89c1cb406646c93778d2ad583d..b0225e0376a73799e4884168800e305e606771f9 100644
--- a/pkg/unittest/lib/html_config.dart
+++ b/pkg/unittest/lib/html_config.dart
@@ -143,6 +143,19 @@ class HtmlConfiguration extends Configuration {
}
}
+/**
+ * Examine the url for this test to determine what the cross-origin port is for
+ * this test.
Siggi Cherem (dart-lang) 2013/01/04 01:49:43 nit: rephase, maybe "The value of the 'crossOrigin
Emily Fortuna 2013/01/04 23:26:54 Done.
+ */
+int getCrossOriginPortNumber() {
Siggi Cherem (dart-lang) 2013/01/04 01:49:43 I think this should not be in unittest. I mean, it
Emily Fortuna 2013/01/04 23:26:54 Good point. Removed.
+ var searchUrl = window.location.search;
+ var crossOriginStr = 'crossOriginPort=';
+ var index = searchUrl.indexOf(crossOriginStr);
+ var nextArg = searchUrl.indexOf('&', index);
+ return int.parse(searchUrl.substring(index + crossOriginStr.length,
+ nextArg == -1 ? searchUrl.length : nextArg));
+}
+
void useHtmlConfiguration([bool isLayoutTest = false]) {
configure(new HtmlConfiguration(isLayoutTest));
}

Powered by Google App Engine
This is Rietveld 408576698