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

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: address comments 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..38736612d4132c4afdb43379a6c84a655fb3431e
--- /dev/null
+++ b/tools/testing/dart/drt_updater.dart
@@ -0,0 +1,46 @@
+// 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");
+#import("dart:builtin");
+
+class DumpRenderTreeUpdater {
+ static bool isActive = false;
+ static bool updated = false;
+ static List onUpdated;
+
+ static Process _updatingProcess;
+
+ 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',
+ 'frogium',
+ 'legium'].some((x) => x == component);
+
+ static String get _getDrtPath() {
+ String scriptPath = new Options().script.replaceAll('\\', '/');
+ String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
+ return '$toolsDir/get_drt.py';
+ }
+
+ static void _onUpdatedHandler(int exit_code) {
+ print('DumpRenderTree updated ($exit_code)');
+ for (var callback in onUpdated ) callback();
+ }
+}
« 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