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

Unified Diff: tools/test.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: tools/test.dart
diff --git a/tools/test.dart b/tools/test.dart
index 8d7388c0a2e29a4b6d4e39133614263e7575d189..80b4bb99fbef0cb57f0cc6fb51579d09bb9395b2 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -81,7 +81,7 @@ main() {
var verbose = firstConf['verbose'];
var printTiming = firstConf['time'];
var listTests = firstConf['list'];
-
+
if (!firstConf['append_flaky_log']) {
var file = new File(TestUtils.flakyFileName());
if (file.existsSync()) {
@@ -104,6 +104,22 @@ main() {
print(Strings.join(output_words, ' '));
}
+ // Start global http servers that serve the entire dart repo.
+ // The http server is available on window.location.port, and a second server
+ // for cross-domain tests can be found by calling getCrossOriginPortNumber().
+ List serverList = [];
+ if (!listTests) {
+ // Only start the server if we are running browser tests.
+ var runningBrowserTests = configurations.some((config) {
+ return TestUtils.isBrowserRuntime(config['runtime']);
+ });
+ if (runningBrowserTests) {
+ serverList.add(startHttpServer('127.0.0.1'));
+ // We start two servers so that we can test cross-domain tests.
+ serverList.add(startHttpServer('127.0.0.1', serverList[0].port));
+ }
+ }
+
var configurationIterator = configurations.iterator();
void enqueueConfiguration(ProcessQueue queue) {
if (!configurationIterator.hasNext) return;
@@ -126,29 +142,18 @@ main() {
final name = testSuiteDir.filename;
if (selectors.containsKey(name)) {
queue.addTestSuite(
- new StandardTestSuite.forDirectory(conf, testSuiteDir));
+ new StandardTestSuite.forDirectory(conf, testSuiteDir, serverList));
}
}
}
- // Start global http server that serves the entire dart repo.
- // The http server is available on localhost:9876 for any
- // test that needs to load resources from the repo over http.
- if (!listTests) {
- // Only start the server if we are running browser tests.
- var runningBrowserTests = configurations.some((config) {
- return TestUtils.isBrowserRuntime(config['runtime']);
- });
- if (runningBrowserTests) startHttpServer('127.0.0.1', 9876);
- }
-
// Start process queue.
new ProcessQueue(maxProcesses,
progressIndicator,
startTime,
printTiming,
enqueueConfiguration,
- () => terminateHttpServer(),
+ () => terminateHttpServers(serverList),
verbose,
listTests);
}

Powered by Google App Engine
This is Rietveld 408576698