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

Unified Diff: tools/testing/dart/drt_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/configuration.dart ('k') | tools/testing/dart/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/drt_updater.dart
diff --git a/tools/testing/dart/drt_updater.dart b/tools/testing/dart/drt_updater.dart
deleted file mode 100644
index dffb67220631c321dbca6a8181a42eed78f9f2a3..0000000000000000000000000000000000000000
--- a/tools/testing/dart/drt_updater.dart
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// TODO(antonm): rename to something like test_runner_updater.
-
-import 'dart:async';
-import 'dart:io';
-
-import 'configuration.dart';
-import 'utils.dart';
-
-typedef void Action();
-
-class _DartiumUpdater {
- String name;
- String script;
- String option;
-
- bool isActive = false;
- bool updated = false;
- List<Action> onUpdated;
-
- Future<ProcessResult> _updatingProcess;
-
- _DartiumUpdater(this.name, this.script, [this.option = null]);
-
- void update() {
- if (!isActive) {
- isActive = true;
- print('Updating $name.');
- onUpdated = [
- () {
- updated = true;
- }
- ];
- _updatingProcess = Process.run('python', _getUpdateCommand);
- _updatingProcess.then(_onUpdatedHandler).catchError((e) {
- print("Error starting $script process: $e");
- // TODO(floitsch): should we print the stacktrace?
- return false;
- });
- }
- }
-
- List<String> get _getUpdateCommand {
- Uri updateScript = TestUtils.dartDirUri.resolve(script);
- List<String> command = [updateScript.toFilePath()];
- if (null != option) {
- command.add(option);
- }
- return command;
- }
-
- void _onUpdatedHandler(ProcessResult result) {
- if (result.exitCode == 0) {
- print('$name updated');
- } else {
- print('Failure updating $name');
- print(' Exit code: ${result.exitCode}');
- print(result.stdout);
- print(result.stderr);
- exit(1);
- }
- for (var callback in onUpdated) callback();
- }
-}
-
-_DartiumUpdater _contentShellUpdater;
-_DartiumUpdater _dartiumUpdater;
-
-_DartiumUpdater runtimeUpdater(
- Runtime runtime, String drtPath, String dartiumPath) {
- if (runtime == Runtime.drt && drtPath == null) {
- // Download the default content shell from Google Storage.
- if (_contentShellUpdater == null) {
- _contentShellUpdater =
- new _DartiumUpdater('Content Shell', 'tools/get_archive.py', 'drt');
- }
- return _contentShellUpdater;
- } else if (runtime == Runtime.dartium && dartiumPath == null) {
- // Download the default Dartium from Google Storage.
- if (_dartiumUpdater == null) {
- _dartiumUpdater = new _DartiumUpdater(
- 'Dartium Chrome', 'tools/get_archive.py', 'dartium');
- }
- return _dartiumUpdater;
- } else {
- return null;
- }
-}
« no previous file with comments | « tools/testing/dart/configuration.dart ('k') | tools/testing/dart/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698