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

Unified Diff: tools/test.dart

Issue 23714002: test.py: Print the warning about left-over dirs only for directories created using Directory.create… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 | tools/testing/dart/test_progress.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/test.dart
diff --git a/tools/test.dart b/tools/test.dart
index 24da3d250377561477c650942e96857bd4be333e..43821872f34f65a13b8fbe2e28178f6819197072 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -262,34 +262,14 @@ Future deleteTemporaryDartDirectories() {
var completer = new Completer();
var environment = Platform.environment;
if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') {
- Directory getTempDir() {
- // dir will be located in the system temporary directory.
- var dir = new Directory('').createTempSync();
- var path = new Path(dir.path).directoryPath;
- dir.deleteSync();
- return new Directory(path.toNativePath());
- }
-
- // These are the patterns of temporary directory names created by
- // 'Directory.createTempSync()' on linux/macos and windows.
- var regExp;
- if (['macos', 'linux'].contains(Platform.operatingSystem)) {
- regExp = new RegExp(r'^temp_dir1_......$');
- } else {
- regExp = new RegExp(r'tempdir-........-....-....-....-............$');
- }
-
- getTempDir().list().listen((directoryEntry) {
- if (directoryEntry is Directory) {
- if (regExp.hasMatch(new Path(directoryEntry.path).filename)) {
+ LeftOverTempDirPrinter.getLeftOverTemporaryDirectories().listen(
+ (Directory tempDirectory) {
try {
- directoryEntry.deleteSync(recursive: true);
+ tempDirectory.deleteSync(recursive: true);
} catch (error) {
DebugLogger.error(error);
}
- }
- }
- }, onDone: completer.complete);
+ }, onDone: completer.complete);
} else {
completer.complete();
}
« no previous file with comments | « no previous file | tools/testing/dart/test_progress.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698