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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 15563002: Correctly set the timeout of tests when using selenium (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 3c454ad2fd87e1e2cac9668532be180c2515ddcc..94c33bb983e0251c5fdef70c198feb91dfc19a7f 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -970,6 +970,20 @@ class AnalysisCommandOutputImpl extends CommandOutputImpl {
}
}
+
+/** Modifies the --timeout=XX parameter passed to run_selenium.py */
+List<String> _modifySeleniumTimeout(List<String> arguments, int timeout) {
+ return arguments.map((argument) {
+ if (argument.startsWith('--timeout=')) {
+ return "--timeout=$timeout";
+ } else {
+ return argument;
+ }
+ }).toList();
+ return;
+}
+
+
/**
* A RunningProcess actually runs a test, getting the command lines from
* its [TestCase], starting the test process (and first, a compilation
@@ -1011,8 +1025,10 @@ class RunningProcess {
_commandComplete(0);
} else {
var processOptions = _createProcessOptions();
+ var commandArguments = _modifySeleniumTimeout(command.arguments,
+ testCase.timeout);
Future processFuture = io.Process.start(command.executable,
- command.arguments,
+ commandArguments,
processOptions);
processFuture.then((io.Process process) {
// Close stdin so that tests that try to block on input will fail.
@@ -1177,7 +1193,8 @@ class BatchRunnerProcess {
"environments for batch runner tests!");
}
- var line = _createArgumentsLine(testCase.batchTestArguments);
+ var line = _createArgumentsLine(testCase.batchTestArguments,
+ testCase.timeout);
_process.stdin.write(line);
_stdoutSubscription.resume();
_stderrSubscription.resume();
@@ -1185,7 +1202,8 @@ class BatchRunnerProcess {
_stderrCompleter.future]).then((_) => _reportResult());
}
- String _createArgumentsLine(List<String> arguments) {
+ String _createArgumentsLine(List<String> arguments, int timeout) {
+ arguments = _modifySeleniumTimeout(arguments, timeout);
return arguments.join(' ').concat('\n');
}
« no previous file with comments | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698