| 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 _DartiumUpdater { | 10 class _DartiumUpdater { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 void _onUpdatedHandler(int exit_code) { | 47 void _onUpdatedHandler(int exit_code) { |
| 48 print('$name updated ($exit_code)'); | 48 print('$name updated ($exit_code)'); |
| 49 for (var callback in onUpdated ) callback(); | 49 for (var callback in onUpdated ) callback(); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 _DartiumUpdater _dumpRenderTreeUpdater; | 53 _DartiumUpdater _dumpRenderTreeUpdater; |
| 54 _DartiumUpdater _dartiumUpdater; | 54 _DartiumUpdater _dartiumUpdater; |
| 55 | 55 |
| 56 _DartiumUpdater runtimeUpdater(String runtime) { | 56 _DartiumUpdater runtimeUpdater(Map configuration) { |
| 57 if (runtime == 'drt') { | 57 String runtime = configuration['runtime']; |
| 58 if (runtime == 'drt' && configuration['drt'] == '') { |
| 59 // Download the default DumpRenderTree from Google Storage. |
| 58 if (_dumpRenderTreeUpdater === null) { | 60 if (_dumpRenderTreeUpdater === null) { |
| 59 _dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree', | 61 _dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree', |
| 60 'get_drt.py'); | 62 'get_drt.py'); |
| 61 } | 63 } |
| 62 return _dumpRenderTreeUpdater; | 64 return _dumpRenderTreeUpdater; |
| 63 } else if (runtime == 'dartium') { | 65 } else if (runtime == 'dartium' && configuration['dartium'] == '') { |
| 66 // Download the default Dartium from Google Storage. |
| 64 if (_dartiumUpdater === null) { | 67 if (_dartiumUpdater === null) { |
| 65 _dartiumUpdater = new _DartiumUpdater('Dartium Chrome', 'get_drt.py', | 68 _dartiumUpdater = new _DartiumUpdater('Dartium Chrome', 'get_drt.py', |
| 66 '--dartium'); | 69 '--dartium'); |
| 67 } | 70 } |
| 68 return _dartiumUpdater; | 71 return _dartiumUpdater; |
| 69 } else { | 72 } else { |
| 70 return null; | 73 return null; |
| 71 } | 74 } |
| 72 } | 75 } |
| OLD | NEW |