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

Unified Diff: tools/test-runtime.dart

Issue 12340021: Start two http servers for every configuration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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-runtime.dart
diff --git a/tools/test-runtime.dart b/tools/test-runtime.dart
index 32e4e074eeaffff9263c39e3381f51960326d07b..b76ec68e4d29d46bfa729f4206285bd48d8883fd 100755
--- a/tools/test-runtime.dart
+++ b/tools/test-runtime.dart
@@ -73,12 +73,21 @@ main() {
}
var testSuites = new List<TestSuite>();
Emily Fortuna 2013/02/22 17:45:30 the value of runningBrowserTests is no longer defi
kustermann 2013/02/22 18:16:38 Thanks for catching that.
- TestingServerRunner.setBuildDir(firstConf);
- TestingServerRunner.setPackageRootDir(firstConf);
for (var conf in configurations) {
+ if (!listTests && runningBrowserTests) {
+ // 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().
+ var servers = new TestingServers(new Path(TestUtils.buildDir(conf)));
+ servers.startServers('127.0.0.1', 9876);
Emily Fortuna 2013/02/22 17:45:30 we can get rid of the 9876 argument, since we can
kustermann 2013/02/22 18:16:38 Well, I didn't know why this magic number was here
Emily Fortuna 2013/02/22 18:42:51 The magic number was there from when Mads original
+ conf['_servers_'] = servers;
+ }
+
if (selectors.containsKey('co19')) {
testSuites.add(new Co19TestSuite(conf));
}
+
if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) {
// vm tests contain both cc tests (added here) and dart tests (added in
// [TEST_SUITE_DIRECTORIES]).
@@ -93,15 +102,13 @@ main() {
}
}
- // 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.any((config) {
- return TestUtils.isBrowserRuntime(config['runtime']);
- });
- if (runningBrowserTests) startHttpServer('127.0.0.1', 9876);
+ void allTestsFinished() {
+ for (var conf in configurations) {
+ if (conf.containsKey('_servers_')) {
+ conf['_servers_'].stopServers();
+ }
+ }
+ DebugLogger.close();
}
var maxBrowserProcesses = maxProcesses;
@@ -114,7 +121,7 @@ main() {
startTime,
printTiming,
testSuites,
- () => TestingServerRunner.terminateHttpServers(),
+ allTestsFinished,
verbose,
listTests);
}

Powered by Google App Engine
This is Rietveld 408576698