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

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

Issue 272543007: Add missing file from revert in revision 36165 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
===================================================================
--- tools/testing/dart/test_runner.dart (revision 36164)
+++ tools/testing/dart/test_runner.dart (working copy)
@@ -93,9 +93,6 @@
String toString() => reproductionCommand;
Future<bool> get outputIsUpToDate => new Future.value(false);
-
- Future<String> get cachedOutput => new Future.value(null);
- Future writeCachedOutput(CommandOutput output) => new Future.value(null);
}
class ProcessCommand extends Command {
@@ -175,24 +172,6 @@
bool _neverSkipCompilation;
List<Uri> _bootstrapDependencies;
- Future writeCachedOutput(CommandOutput output) {
- var file = new io.File(TestUtils.cachedOutputFile(_outputFile));
- return file.writeAsString(output.json)
- .catchError((error) {
- DebugLogger.warning("Could not write cached output: $error");
- return null;
- });
- }
-
- Future<CommandOutput> get cachedOutput {
- var file = new io.File(TestUtils.cachedOutputFile(_outputFile));
- return file.exists().then((exists) {
- if (exists) return file.readAsString().then((content) {
- return new CompilationCommandOutputImpl.fromJson(this, content);
- });;
- });
- }
-
CompilationCommand._(String displayName,
this._outputFile,
this._neverSkipCompilation,
@@ -226,28 +205,22 @@
});
}
- bool isUpToDate(lastModified, dependencies) {
- if (lastModified == null) return false;
- for (var dependency in dependencies) {
- var dependencyLastModified =
- TestUtils.lastModifiedCache.getLastModified(dependency);
- if (dependencyLastModified == null ||
- dependencyLastModified.isAfter(lastModified)) {
- return false;
- }
- }
- return true;
- }
-
return readDepsFile("$_outputFile.deps").then((dependencies) {
if (dependencies != null) {
dependencies.addAll(_bootstrapDependencies);
- // We check if the cached output is up to date, if so we return true
- var cachedOutputFile = TestUtils.cachedOutputFile(_outputFile);
- var cachedOutputUri = new Uri(scheme: 'file', path: cachedOutputFile);
- var cachedOutputLastModified =
- TestUtils.lastModifiedCache.getLastModified(cachedOutputUri);
- return isUpToDate(cachedOutputLastModified, dependencies);
+ var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified(
+ new Uri(scheme: 'file', path: _outputFile));
+ if (jsOutputLastModified != null) {
+ for (var dependency in dependencies) {
+ var dependencyLastModified =
+ TestUtils.lastModifiedCache.getLastModified(dependency);
+ if (dependencyLastModified == null ||
+ dependencyLastModified.isAfter(jsOutputLastModified)) {
+ return false;
+ }
+ }
+ return true;
+ }
}
return false;
});
@@ -946,8 +919,6 @@
List<String> get diagnostics;
bool get compilationSkipped;
-
- String get json;
}
class CommandOutputImpl extends UniqueObject implements CommandOutput {
@@ -1037,9 +1008,6 @@
}
return Expectation.FAIL;
}
-
- String get json => null;
-
}
class BrowserCommandOutputImpl extends CommandOutputImpl {
@@ -1637,32 +1605,6 @@
exitCode == 0 ? Expectation.PASS : Expectation.COMPILETIME_ERROR;
return _negateOutcomeIfNegativeTest(outcome, testCase.isNegative);
}
-
- String get json {
- var map = {
- 'stdout': stdout,
- 'stderr': stderr,
- 'exitCode': exitCode,
- 'timedOut': timedOut,
- };
- return JSON.encode(map);
- }
-
- factory CompilationCommandOutputImpl.fromJson(Command command,
- String json) {
- var obj = JSON.decode(json);
- for (var v in ['stdout', 'stderr', 'exitCode', 'timedOut']) {
- assert(obj.containsKey(v));
- }
- return new CompilationCommandOutputImpl(command,
- obj['exitCode'],
- obj['timedOut'],
- obj['stdout'],
- obj['stderr'],
- const Duration(seconds: 0),
- true);
-
- }
}
class JsCommandlineOutputImpl extends CommandOutputImpl
@@ -1860,12 +1802,10 @@
}
void _runCommand() {
- command.outputIsUpToDate.then((isUpToDate) {
+ command.outputIsUpToDate.then((bool isUpToDate) {
if (isUpToDate) {
compilationSkipped = true;
- command.cachedOutput.then((cached) {
- _commandComplete(cached.exitCode, cachedOutput: cached);
- });
+ _commandComplete(0);
} else {
var processEnvironment = _createProcessEnvironment();
Future processFuture =
@@ -1958,17 +1898,12 @@
});
}
- void _commandComplete(int exitCode, {cachedOutput: null}) {
+ void _commandComplete(int exitCode) {
if (timeoutTimer != null) {
timeoutTimer.cancel();
}
- if (cachedOutput != null) {
- completer.complete(cachedOutput);
- } else {
- var commandOutput = _createCommandOutput(command, exitCode);
- command.writeCachedOutput(commandOutput);
- completer.complete(commandOutput);
- }
+ var commandOutput = _createCommandOutput(command, exitCode);
+ completer.complete(commandOutput);
}
CommandOutput _createCommandOutput(ProcessCommand command, int exitCode) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698