| 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 // TODO(antonm): rename to something like test_runner_updater. | 5 // TODO(antonm): rename to something like test_runner_updater. | 
| 6 | 6 | 
| 7 library drt_updater; | 7 library drt_updater; | 
| 8 | 8 | 
| 9 import "dart:async"; | 9 import "dart:async"; | 
| 10 import "dart:io"; | 10 import "dart:io"; | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 64       exit(1); | 64       exit(1); | 
| 65     } | 65     } | 
| 66     for (var callback in onUpdated) callback(); | 66     for (var callback in onUpdated) callback(); | 
| 67   } | 67   } | 
| 68 } | 68 } | 
| 69 | 69 | 
| 70 _DartiumUpdater _contentShellUpdater; | 70 _DartiumUpdater _contentShellUpdater; | 
| 71 _DartiumUpdater _dartiumUpdater; | 71 _DartiumUpdater _dartiumUpdater; | 
| 72 | 72 | 
| 73 _DartiumUpdater runtimeUpdater(Map configuration) { | 73 _DartiumUpdater runtimeUpdater(Map configuration) { | 
| 74   String runtime = configuration['runtime']; | 74   var runtime = configuration['runtime'] as String; | 
| 75   if (runtime == 'drt' && configuration['drt'] == '') { | 75   if (runtime == 'drt' && configuration['drt'] == '') { | 
| 76     // Download the default content shell from Google Storage. | 76     // Download the default content shell from Google Storage. | 
| 77     if (_contentShellUpdater == null) { | 77     if (_contentShellUpdater == null) { | 
| 78       _contentShellUpdater = | 78       _contentShellUpdater = | 
| 79           new _DartiumUpdater('Content Shell', 'tools/get_archive.py', 'drt'); | 79           new _DartiumUpdater('Content Shell', 'tools/get_archive.py', 'drt'); | 
| 80     } | 80     } | 
| 81     return _contentShellUpdater; | 81     return _contentShellUpdater; | 
| 82   } else if (runtime == 'dartium' && configuration['dartium'] == '') { | 82   } else if (runtime == 'dartium' && configuration['dartium'] == '') { | 
| 83     // Download the default Dartium from Google Storage. | 83     // Download the default Dartium from Google Storage. | 
| 84     if (_dartiumUpdater == null) { | 84     if (_dartiumUpdater == null) { | 
| 85       _dartiumUpdater = new _DartiumUpdater( | 85       _dartiumUpdater = new _DartiumUpdater( | 
| 86           'Dartium Chrome', 'tools/get_archive.py', 'dartium'); | 86           'Dartium Chrome', 'tools/get_archive.py', 'dartium'); | 
| 87     } | 87     } | 
| 88     return _dartiumUpdater; | 88     return _dartiumUpdater; | 
| 89   } else { | 89   } else { | 
| 90     return null; | 90     return null; | 
| 91   } | 91   } | 
| 92 } | 92 } | 
| OLD | NEW | 
|---|