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

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: 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
9 class DumpRenderTreeUpdater {
10 static bool isActive = false;
11 static bool updated = false;
12 static List onUpdated;
13
14 static Process updatingProcess;
Mads Ager (google) 2012/03/12 14:09:20 Make this private?
Bill Hesse 2012/03/12 18:13:35 Done.
15
16 static void update() {
17 if (!isActive) {
18 isActive = true;
19 print('Updating DumpRenderTree.');
20 onUpdated = [() {updated = true;} ];
21 updatingProcess = new Process.start('python', [getDrtPath]);
22 updatingProcess.onExit = onUpdatedHandler;
23 updatingProcess.onError = (error) {
24 print("Error starting get_drt.py process: $error");
25 onUpdatedHandler(-1); // Continue anyway.
26 };
27 }
28 }
29
30 static bool componentRequiresDRT(String component) =>
31 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
32 'chromium',
33 'frogium',
34 'legium',
35 '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.
36
37 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.
38 String scriptPath = new Options().script.replaceAll('\\', '/');
39 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/'));
40 return '$toolsDir/get_drt.py';
41 }
42
43 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.
44 // blah blah blah
Bill Hesse 2012/03/12 13:38:32 Remove Bob Loblaw.
Bill Hesse 2012/03/12 18:13:35 Done.
45 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.
46 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.
47 }
48
49 }
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