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

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

Issue 252653007: Add clear_browser_cache flag to test.dart (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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/test.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/browser_controller.dart
===================================================================
--- tools/testing/dart/browser_controller.dart (revision 35471)
+++ tools/testing/dart/browser_controller.dart (working copy)
@@ -49,6 +49,12 @@
*/
String id;
+ /**
+ * Delete the browser specific caches on startup.
+ * Browser specific implementations are free to ignore this.
+ */
+ static bool deleteCache = false;
+
/** Print everything (stdout, stderr, usageLog) whenever we add to it */
bool debugPrint = false;
@@ -298,7 +304,7 @@
// Clears the cache if the static deleteCache flag is set.
// Returns false if the command to actually clear the cache did not complete.
Future<bool> clearCache() {
- if (!deleteCache) return new Future.value(true);
+ if (!Browser.deleteCache) return new Future.value(true);
var home = Platform.environment['HOME'];
Iterator iterator = CACHE_DIRECTORIES.map((s) => "$home/$s").iterator;
return deleteIfExists(iterator);
@@ -374,11 +380,6 @@
}
String toString() => "Safari";
-
- // Delete the user specific browser cache and profile data.
- // Safari only have one per user, and you can't specify one by command line.
- static bool deleteCache = false;
-
}
@@ -480,14 +481,30 @@
});
}
+ // Clears the recovery cache if the static deleteCache flag is set.
+ Future<bool> clearCache() {
+ if (!Browser.deleteCache) return new Future.value(true);
+ var localAppData = Platform.environment['LOCALAPPDATA'];
+
+ Directory dir = new Directory("$localAppData\\Microsoft\\"
+ "Internet Explorer\\Recovery");
+ return dir.delete(recursive: true)
+ .then((_) { return true; })
+ .catchError((error) {
+ _logEvent("Deleting recovery dir failed with $error");
+ return false;
+ });
+ }
+
Future<bool> start(String url) {
_logEvent("Starting ie browser on: $url");
- return getVersion().then((version) {
+ return clearCache().then((_) => getVersion()).then((version) {
_logEvent("Got version: $version");
return startBrowser(_binary, [url]);
});
}
String toString() => "IE";
+
}
« no previous file with comments | « tools/test.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698