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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc

Issue 1243293003: Platform-specific prune state storage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prune1
Patch Set: moved uninstall cleanup to separate cl Created 5 years, 3 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/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
index 7303ea217c990ecfe7738330a76b93e768a20cd0..601086fb6b94b930c4c79e3b041674c3f7a10bc3 100644
--- a/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc
@@ -30,6 +30,10 @@
#include "net/url_request/url_request_context_getter.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_WIN)
+#include "base/test/test_reg_util_win.h"
+#endif
+
// A test fixture that sets up a test task runner and makes it the thread's
// runner. The fixture implements a fake envrionment data collector and a fake
// report uploader.
@@ -180,6 +184,11 @@ class IncidentReportingServiceTest : public testing::Test {
void SetUp() override {
testing::Test::SetUp();
+#if defined(OS_WIN)
+ // Redirect HKCU so that the platform state store used by the test doesn't
+ // collide with existing Chrome installs or other tests running in parallel.
+ registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER);
+#endif
ASSERT_TRUE(profile_manager_.SetUp());
}
@@ -471,6 +480,10 @@ class IncidentReportingServiceTest : public testing::Test {
receiver->AddIncidentForProcess(MakeTestIncident(nullptr));
}
+#if defined(OS_WIN)
+ registry_util::RegistryOverrideManager registry_override_manager_;
+#endif
+
// A mapping of profile name to its corresponding properties.
std::map<std::string, ProfileProperties> profile_properties_;
};

Powered by Google App Engine
This is Rietveld 408576698