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)); |
} |