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

Unified Diff: chrome/installer/util/product_state_unittest.cc

Issue 2692843002: Fail tests fast if overriding the Windows registry fails. (Closed)
Patch Set: sync to position 450085 Created 3 years, 10 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 | « chrome/installer/util/install_util_unittest.cc ('k') | chrome/installer/util/product_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/product_state_unittest.cc
diff --git a/chrome/installer/util/product_state_unittest.cc b/chrome/installer/util/product_state_unittest.cc
index 37fbc5dc1d54e216a6e09388dff1046f75d179f3..1d07b51af52169faed81588ecaab02533f14c215 100644
--- a/chrome/installer/util/product_state_unittest.cc
+++ b/chrome/installer/util/product_state_unittest.cc
@@ -19,6 +19,8 @@ class ProductStateTest : public testing::TestWithParam<bool> {
protected:
ProductStateTest();
+ void SetUp() override;
+
void ApplyUninstallCommand(const wchar_t* exe_path, const wchar_t* args);
void MinimallyInstallProduct(const wchar_t* version);
@@ -31,14 +33,17 @@ class ProductStateTest : public testing::TestWithParam<bool> {
ProductStateTest::ProductStateTest()
: system_install_(GetParam()),
- overridden_(system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER) {
- registry_override_manager_.OverrideRegistry(overridden_);
+ overridden_(system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER) {}
+
+void ProductStateTest::SetUp() {
+ ASSERT_NO_FATAL_FAILURE(
+ registry_override_manager_.OverrideRegistry(overridden_));
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- EXPECT_EQ(ERROR_SUCCESS,
+ ASSERT_EQ(ERROR_SUCCESS,
clients_.Create(overridden_, dist->GetVersionKey().c_str(),
KEY_ALL_ACCESS | KEY_WOW64_32KEY));
- EXPECT_EQ(ERROR_SUCCESS,
+ ASSERT_EQ(ERROR_SUCCESS,
client_state_.Create(overridden_, dist->GetStateKey().c_str(),
KEY_ALL_ACCESS | KEY_WOW64_32KEY));
}
« no previous file with comments | « chrome/installer/util/install_util_unittest.cc ('k') | chrome/installer/util/product_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698