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

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

Issue 9960050: Add runtime=dartium webdriver support to test.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for batching Created 8 years, 8 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_options.dart » ('j') | tools/testing/run_selenium.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/drt_updater.dart
diff --git a/tools/testing/dart/drt_updater.dart b/tools/testing/dart/drt_updater.dart
index 4768d17dae7463da85e562a142eb50493cc9ba98..8d24ff0bf0377ef4d3686191d6bcc7cabb1a42c1 100644
--- a/tools/testing/dart/drt_updater.dart
+++ b/tools/testing/dart/drt_updater.dart
@@ -7,35 +7,66 @@
#import("dart:io");
#import("dart:builtin");
-class DumpRenderTreeUpdater {
- static bool isActive = false;
- static bool updated = false;
- static List onUpdated;
+class _DartiumUpdater {
+ String name;
+ String script;
+ String option;
- static Process _updatingProcess;
+ bool isActive = false;
+ bool updated = false;
+ List onUpdated;
- static void update() {
+ Process _updatingProcess;
+
+ _DartiumUpdater(this.name, this.script, [this.option = null]);
+
+ void update() {
if (!isActive) {
isActive = true;
- print('Updating DumpRenderTree.');
+ print('Updating $name.');
onUpdated = [() {updated = true;} ];
- _updatingProcess = new Process.start('python', [_getDrtPath]);
+ _updatingProcess = new Process.start('python', _getUpdateCommand);
_updatingProcess.onExit = _onUpdatedHandler;
_updatingProcess.onError = (error) {
- print("Error starting get_drt.py process: $error");
+ print("Error starting $script process: $error");
_onUpdatedHandler(-1); // Continue anyway.
};
}
}
- static String get _getDrtPath() {
+ String get _getUpdateCommand() {
String scriptPath = new Options().script.replaceAll('\\', '/');
String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
- return '$toolsDir/get_drt.py';
+ List<String> command = ['$toolsDir/$script'];
+ if (null !== option) {
+ command.add(option);
+ }
+ return command;
}
- static void _onUpdatedHandler(int exit_code) {
- print('DumpRenderTree updated ($exit_code)');
+ void _onUpdatedHandler(int exit_code) {
+ print('$name updated ($exit_code)');
for (var callback in onUpdated ) callback();
}
}
+
+_DartiumUpdater _dumpRenderTreeUpdater;
+_DartiumUpdater _dartiumUpdater;
+
+_DartiumUpdater runtimeUpdater(String runtime) {
+ if (runtime == 'drt') {
+ if (_dumpRenderTreeUpdater === null) {
+ _dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree',
+ 'get_drt.py');
+ }
+ return _dumpRenderTreeUpdater;
+ } else if (runtime == 'dartium') {
+ if (_dartiumUpdater === null) {
+ _dartiumUpdater = new _DartiumUpdater('Dartium Chrome', 'get_drt.py',
+ '--dartium');
+ }
+ return _dartiumUpdater;
+ } else {
+ return null;
+ }
+}
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | tools/testing/run_selenium.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698