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

Unified Diff: chrome/test/base/chrome_test_launcher.cc

Issue 2893703002: Cleanup PreferenceMACs on browser_tests startup (Closed)
Patch Set: re-enable PrefHashBrowserTests disabled for this issue Created 3 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
Index: chrome/test/base/chrome_test_launcher.cc
diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc
index a6e39530d5e307530e1de9bd951a0a9369f1db67..d83f87d3d44571beb0f4defbd896fac04e1c9e1d 100644
--- a/chrome/test/base/chrome_test_launcher.cc
+++ b/chrome/test/base/chrome_test_launcher.cc
@@ -52,7 +52,9 @@
#endif
#if defined(OS_WIN)
+#include "base/win/registry.h"
#include "chrome/app/chrome_crash_reporter_client_win.h"
+#include "chrome/install_static/install_util.h"
#endif
ChromeTestSuiteRunner::ChromeTestSuiteRunner() {}
@@ -96,6 +98,21 @@ ChromeTestLauncherDelegate::CreateContentMainDelegate() {
return new ChromeMainDelegate();
}
+void ChromeTestLauncherDelegate::PreShardingCleanup() {
+#if defined(OS_WIN)
+ // Pre-test cleanup for registry state keyed off the profile dir (which can
+ // proliferate with the use of uniquely named scoped_dirs):
+ // https://crbug.com/721245. This needs to be here in order not to be racy
+ // with any tests that will access that state.
+ base::win::RegKey key(HKEY_CURRENT_USER,
+ install_static::GetRegistryPath().c_str(),
+ KEY_SET_VALUE | KEY_QUERY_VALUE);
+ if (key.Valid()) {
+ key.DeleteKey(L"PreferenceMACs");
jam 2017/05/17 19:06:16 does this mean that if someone runs official brows
gab 2017/05/17 20:01:05 Yes, but it's not that bad (discussed details offl
+ }
+#endif
+}
+
int LaunchChromeTests(int default_jobs,
content::TestLauncherDelegate* delegate,
int argc,

Powered by Google App Engine
This is Rietveld 408576698