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

Unified Diff: utils/testrunner/client_server_task.dart

Issue 10966020: Added support for running an HTTP server during the test and being able to serve up static files. L… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « no previous file | utils/testrunner/configuration.dart » ('j') | utils/testrunner/dart2js_task.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/testrunner/client_server_task.dart
===================================================================
--- utils/testrunner/client_server_task.dart (revision 0)
+++ utils/testrunner/client_server_task.dart (revision 0)
@@ -0,0 +1,30 @@
+
Siggi Cherem (dart-lang) 2012/09/20 23:55:41 +copyright, + docs, + #library
gram 2012/09/21 00:25:46 Done the first two; this is #sourced into testrunn
Siggi Cherem (dart-lang) 2012/09/21 00:37:53 that will change soon, now that the new import syn
+class RunClientServerTask extends RunProcessTask {
+ RunProcessTask serverTask;
+ Process serverProcess;
+
+ RunClientServerTask(String commandTemplate, List argumentTemplates,
+ int timeout) : super(commandTemplate, argumentTemplates, timeout) {
+ serverTask = new RunProcessTask(
+ config.dartPath,
+ ['$runnerDirectory${Platform.pathSeparator}'
+ 'http_server_test_runner.dart',
+ '--port=${config.port}',
+ '--root=${config.staticRoot}'],
+ 1000*timeout);
Siggi Cherem (dart-lang) 2012/09/20 23:55:41 spaces around *
gram 2012/09/21 00:25:46 Done.
+ }
+
+ execute(Path testfile, List stdout, List stderr,
+ bool logging, Function exitHandler) {
+ serverProcess = serverTask.execute(testfile, stdout, stderr, logging,
+ (e) { serverProcess = null; });
+ super.execute(testfile, stdout, stderr, logging, exitHandler);
+ }
+
+ void cleanup(Path testfile, List stdout, List stderr,
+ bool verboseLogging, bool keepTestFiles) {
+ if (serverProcess != null) {
+ serverProcess.kill();
+ }
+ }
+}
« no previous file with comments | « no previous file | utils/testrunner/configuration.dart » ('j') | utils/testrunner/dart2js_task.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698