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 2666833004: Delete app jit or aot snapshots as each test is completed to reduce the amount of disk space requir… (Closed)
Patch Set: review Created 3 years, 11 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') | 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
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 1680066f6a7c925f9256b86ee68383bb108f5f1b..0641fbe3065c96f0de34edc9c84447f1c5eb0f94 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -525,6 +525,38 @@ class CleanDirectoryCopyCommand extends ScriptCommand {
_destinationDirectory == other._destinationDirectory;
}
+class DeleteCommand extends ScriptCommand {
+ final String _filename;
+
+ DeleteCommand._(this._filename) : super._('delete');
+
+ String get reproductionCommand =>
+ "Deleting $_filename";
+
+ Future<ScriptCommandOutputImpl> run() {
+ var watch = new Stopwatch()..start();
+
+ var file = new io.File(_filename);
+
+ return file.delete(recursive: true).then((io.File file) {
+ return new ScriptCommandOutputImpl(
+ this, Expectation.PASS, "", watch.elapsed);
+ }).catchError((error) {
+ return new ScriptCommandOutputImpl(
+ this, Expectation.FAIL, "An error occured: $error.", watch.elapsed);
+ });
+ }
+
+ void _buildHashCode(HashCodeBuilder builder) {
+ super._buildHashCode(builder);
+ builder.addJson(_filename);
+ }
+
+ bool _equal(DeleteCommand other) =>
+ super._equal(other) &&
+ _filename == other._filename;
+}
+
class ModifyPubspecYamlCommand extends ScriptCommand {
String _pubspecYamlFile;
String _destinationFile;
@@ -788,6 +820,11 @@ class CommandBuilder {
return _getUniqueCommand(command);
}
+ Command getDeleteCommand(String filename) {
+ var command = new DeleteCommand._(filename);
+ return _getUniqueCommand(command);
+ }
+
Command getPubCommand(String pubCommand, String pubExecutable,
String pubspecYamlDirectory, String pubCacheDirectory) {
var command = new PubCommand._(
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698