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

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

Issue 9666053: Add get_drt.py to test.dart, so that testing browser components updates DumpRenderTree. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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') | no next file with comments »
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
new file mode 100644
index 0000000000000000000000000000000000000000..794df4460ca854bd75fc5d76f8b8e49506cc2c60
--- /dev/null
+++ b/tools/testing/dart/drt_updater.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#library("drt_updater");
+
+#import("dart:io");
+
+class DumpRenderTreeUpdater {
+ static bool isActive = false;
+ static bool updated = false;
+ static List onUpdated;
+
+ static Process updatingProcess;
Mads Ager (google) 2012/03/12 14:09:20 Make this private?
Bill Hesse 2012/03/12 18:13:35 Done.
+
+ static void update() {
+ if (!isActive) {
+ isActive = true;
+ print('Updating DumpRenderTree.');
+ onUpdated = [() {updated = true;} ];
+ updatingProcess = new Process.start('python', [getDrtPath]);
+ updatingProcess.onExit = onUpdatedHandler;
+ updatingProcess.onError = (error) {
+ print("Error starting get_drt.py process: $error");
+ onUpdatedHandler(-1); // Continue anyway.
+ };
+ }
+ }
+
+ static bool componentRequiresDRT(String component) =>
+ const <String>['dartium',
Mads Ager (google) 2012/03/12 14:09:20 return TestUtils.isBrowserComponent(component)?
Bill Hesse 2012/03/12 18:13:35 This is an open question - should these be assumed
+ 'chromium',
+ 'frogium',
+ 'legium',
+ 'webdriver'].some((x) => x == component);
vsm 2012/03/12 15:53:21 webdriver shouldn't need DRT. It'll use chrome (o
Bill Hesse 2012/03/12 18:13:35 Done.
+
+ static String get getDrtPath() {
Mads Ager (google) 2012/03/12 14:09:20 Make this private?
Bill Hesse 2012/03/12 18:13:35 Done.
+ String scriptPath = new Options().script.replaceAll('\\', '/');
+ String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
+ return '$toolsDir/get_drt.py';
+ }
+
+ static void onUpdatedHandler(int exit_code) {
Mads Ager (google) 2012/03/12 14:09:20 Make this private.
Bill Hesse 2012/03/12 18:13:35 Done.
+ // blah blah blah
Bill Hesse 2012/03/12 13:38:32 Remove Bob Loblaw.
Bill Hesse 2012/03/12 18:13:35 Done.
+ print('DumpRenderTree updated($exit_code)');
Mads Ager (google) 2012/03/12 14:09:20 Space between "updated" and "($exit_code)"?
Bill Hesse 2012/03/12 18:13:35 Done.
+ for (var callback in onUpdated ) callback();
Mads Ager (google) 2012/03/12 14:09:20 Remove trailing space after onUpdated.
Bill Hesse 2012/03/12 18:13:35 Done.
+ }
+
+}
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698