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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #library("drt_updater");
6
7 #import("dart:io");
8 #import("dart:builtin");
9
10 class DumpRenderTreeUpdater {
11 static bool isActive = false;
12 static bool updated = false;
13 static List onUpdated;
14
15 static Process _updatingProcess;
16
17 static void update() {
18 if (!isActive) {
19 isActive = true;
20 print('Updating DumpRenderTree.');
21 onUpdated = [() {updated = true;} ];
22 _updatingProcess = new Process.start('python', [_getDrtPath]);
23 _updatingProcess.onExit = _onUpdatedHandler;
24 _updatingProcess.onError = (error) {
25 print("Error starting get_drt.py process: $error");
26 _onUpdatedHandler(-1); // Continue anyway.
27 };
28 }
29 }
30
31 static bool componentRequiresDRT(String component) =>
32 const <String>['dartium',
33 'frogium',
34 'legium'].some((x) => x == component);
35
36 static String get _getDrtPath() {
37 String scriptPath = new Options().script.replaceAll('\\', '/');
38 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
39 return '$toolsDir/get_drt.py';
40 }
41
42 static void _onUpdatedHandler(int exit_code) {
43 print('DumpRenderTree updated ($exit_code)');
44 for (var callback in onUpdated ) callback();
45 }
46 }
OLDNEW
« 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