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

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

Issue 2946783002: Simplify CommandOutput and friends. (Closed)
Patch Set: Merge branch 'master' into simplify-command-output Created 3 years, 6 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/browser_controller.dart ('k') | tools/testing/dart/command_output.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/command.dart
diff --git a/tools/testing/dart/command.dart b/tools/testing/dart/command.dart
index 585f742971c5c63dd6bac3227a8bb546b0242fe6..e2b50b2e733cc0dceed0615b6357bfa4a7741dac 100644
--- a/tools/testing/dart/command.dart
+++ b/tools/testing/dart/command.dart
@@ -237,25 +237,18 @@ class CompilationCommand extends ProcessCommand {
bool get outputIsUpToDate {
if (_alwaysCompile) return false;
- List<Uri> readDepsFile(String path) {
- var file = new io.File(new Path(path).toNativePath());
- if (!file.existsSync()) return null;
-
- var lines = file.readAsLinesSync();
- var dependencies = <Uri>[];
- for (var line in lines) {
- line = line.trim();
- if (line.isNotEmpty) {
- dependencies.add(Uri.parse(line));
- }
+ var file = new io.File(new Path("$_outputFile.deps").toNativePath());
+ if (!file.existsSync()) return false;
+
+ var lines = file.readAsLinesSync();
+ var dependencies = <Uri>[];
+ for (var line in lines) {
+ line = line.trim();
+ if (line.isNotEmpty) {
+ dependencies.add(Uri.parse(line));
}
-
- return dependencies;
}
- var dependencies = readDepsFile("$_outputFile.deps");
- if (dependencies == null) return false;
-
dependencies.addAll(_bootstrapDependencies);
var jsOutputLastModified = TestUtils.lastModifiedCache
.getLastModified(new Uri(scheme: 'file', path: _outputFile));
@@ -512,7 +505,7 @@ class PubCommand extends ProcessCommand {
abstract class ScriptCommand extends Command {
ScriptCommand._(String displayName) : super._(displayName);
- Future<ScriptCommandOutputImpl> run();
+ Future<ScriptCommandOutput> run();
}
class CleanDirectoryCopyCommand extends ScriptCommand {
@@ -525,7 +518,7 @@ class CleanDirectoryCopyCommand extends ScriptCommand {
String get reproductionCommand =>
"Copying '$_sourceDirectory' to '$_destinationDirectory'.";
- Future<ScriptCommandOutputImpl> run() {
+ Future<ScriptCommandOutput> run() {
var watch = new Stopwatch()..start();
var destination = new io.Directory(_destinationDirectory);
@@ -541,10 +534,9 @@ class CleanDirectoryCopyCommand extends ScriptCommand {
return TestUtils.copyDirectory(_sourceDirectory, _destinationDirectory);
});
}).then((_) {
- return new ScriptCommandOutputImpl(
- this, Expectation.pass, "", watch.elapsed);
+ return new ScriptCommandOutput(this, Expectation.pass, "", watch.elapsed);
}).catchError((error) {
- return new ScriptCommandOutputImpl(
+ return new ScriptCommandOutput(
this, Expectation.fail, "An error occured: $error.", watch.elapsed);
});
}
@@ -571,7 +563,7 @@ class MakeSymlinkCommand extends ScriptCommand {
String get reproductionCommand =>
"Make symbolic link '$_link' (target: $_target)'.";
- Future<ScriptCommandOutputImpl> run() {
+ Future<ScriptCommandOutput> run() {
var watch = new Stopwatch()..start();
var targetFile = new io.Directory(_target);
return targetFile.exists().then((bool targetExists) {
@@ -584,10 +576,9 @@ class MakeSymlinkCommand extends ScriptCommand {
if (exists) return link.delete();
}).then((_) => link.create(_target));
}).then((_) {
- return new ScriptCommandOutputImpl(
- this, Expectation.pass, "", watch.elapsed);
+ return new ScriptCommandOutput(this, Expectation.pass, "", watch.elapsed);
}).catchError((error) {
- return new ScriptCommandOutputImpl(
+ return new ScriptCommandOutput(
this, Expectation.fail, "An error occured: $error.", watch.elapsed);
});
}
« no previous file with comments | « tools/testing/dart/browser_controller.dart ('k') | tools/testing/dart/command_output.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698