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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * A RunClientServerTask is like a regular RunProcessTask except it starts
7 * an HTTP server before the task and stops it afterwards, so the task
8 * would typically be making HTTP client requests.
9 */
10 class RunClientServerTask extends RunProcessTask {
11 RunProcessTask serverTask;
12 Process serverProcess;
13
14 RunClientServerTask(String commandTemplate, List argumentTemplates,
15 int timeout) : super(commandTemplate, argumentTemplates, timeout) {
16 serverTask = new RunProcessTask(
17 config.dartPath,
18 ['$runnerDirectory${Platform.pathSeparator}'
19 'http_server_test_runner.dart',
20 '--port=${config.port}',
21 '--root=${config.staticRoot}'],
22 1000 * timeout);
23 }
24
25 execute(Path testfile, List stdout, List stderr,
26 bool logging, Function exitHandler) {
27 serverProcess = serverTask.execute(testfile, stdout, stderr, logging,
28 (e) { serverProcess = null; });
29 super.execute(testfile, stdout, stderr, logging, exitHandler);
30 }
31
32 void cleanup(Path testfile, List stdout, List stderr,
33 bool verboseLogging, bool keepTestFiles) {
34 if (serverProcess != null) {
35 serverProcess.kill();
36 }
37 }
38 }
OLDNEW
« no previous file with comments | « no previous file | utils/testrunner/configuration.dart » ('j') | utils/testrunner/http_server_test_runner.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698