OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #library("drt_updater"); | 5 #library("drt_updater"); |
6 | 6 |
7 #import("dart:io"); | 7 #import("dart:io"); |
8 #import("dart:builtin"); | 8 #import("dart:builtin"); |
9 | 9 |
10 class DumpRenderTreeUpdater { | 10 class DumpRenderTreeUpdater { |
(...skipping 10 matching lines...) Expand all Loading... |
21 onUpdated = [() {updated = true;} ]; | 21 onUpdated = [() {updated = true;} ]; |
22 _updatingProcess = new Process.start('python', [_getDrtPath]); | 22 _updatingProcess = new Process.start('python', [_getDrtPath]); |
23 _updatingProcess.onExit = _onUpdatedHandler; | 23 _updatingProcess.onExit = _onUpdatedHandler; |
24 _updatingProcess.onError = (error) { | 24 _updatingProcess.onError = (error) { |
25 print("Error starting get_drt.py process: $error"); | 25 print("Error starting get_drt.py process: $error"); |
26 _onUpdatedHandler(-1); // Continue anyway. | 26 _onUpdatedHandler(-1); // Continue anyway. |
27 }; | 27 }; |
28 } | 28 } |
29 } | 29 } |
30 | 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() { | 31 static String get _getDrtPath() { |
37 String scriptPath = new Options().script.replaceAll('\\', '/'); | 32 String scriptPath = new Options().script.replaceAll('\\', '/'); |
38 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); | 33 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); |
39 return '$toolsDir/get_drt.py'; | 34 return '$toolsDir/get_drt.py'; |
40 } | 35 } |
41 | 36 |
42 static void _onUpdatedHandler(int exit_code) { | 37 static void _onUpdatedHandler(int exit_code) { |
43 print('DumpRenderTree updated ($exit_code)'); | 38 print('DumpRenderTree updated ($exit_code)'); |
44 for (var callback in onUpdated ) callback(); | 39 for (var callback in onUpdated ) callback(); |
45 } | 40 } |
46 } | 41 } |
OLD | NEW |