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

Unified Diff: tools/testing/dart/runtime_updater.dart

Issue 2981223002: Remove Dartium support from test.dart. (Closed)
Patch Set: Remove "dartium" from status files. Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/status_reporter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/runtime_updater.dart
diff --git a/tools/testing/dart/runtime_updater.dart b/tools/testing/dart/runtime_updater.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4f59a26a52741821756dc20d0d9f10b3d34b5e25
--- /dev/null
+++ b/tools/testing/dart/runtime_updater.dart
@@ -0,0 +1,52 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+
+import 'utils.dart';
+
+Future _contentShellFuture;
+
+/// Runs "tools/get_archive.py" to download and install Content Shell.
+Future updateContentShell(String drtPath) {
+ if (_contentShellFuture == null) {
+ _contentShellFuture =
+ new _RuntimeUpdater('Content Shell', 'tools/get_archive.py', 'drt')
+ .update();
+ }
+
+ return _contentShellFuture;
+}
+
+class _RuntimeUpdater {
+ String _name;
+ String _script;
+ String _option;
+
+ _RuntimeUpdater(this._name, this._script, [this._option]);
+
+ Future update() async {
+ try {
+ print('Updating $_name...');
+
+ var arguments = [TestUtils.dartDirUri.resolve(_script).toFilePath()];
+
+ if (_option != null) arguments.add(_option);
+
+ var result = await Process.run('python', arguments);
+ if (result.exitCode == 0) {
+ print('Updated $_name.');
+ } else {
+ print('Failed to update $_name (exit code ${result.exitCode}):');
+ print(result.stdout);
+ print(result.stderr);
+ exit(1);
+ }
+ } catch (error) {
+ print("Error starting $_script process: $error");
+ exit(1);
+ }
+ }
+}
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/status_reporter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698