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

Unified Diff: base/test/test_reg_util_win_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 | « base/test/test_reg_util_win.cc ('k') | chrome/browser/downgrade/user_data_downgrade_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_reg_util_win_unittest.cc
diff --git a/base/test/test_reg_util_win_unittest.cc b/base/test/test_reg_util_win_unittest.cc
index 9534fef4c4e94e6dd769b534a5f390ef5a8dfe57..ca3bc9927792f8cb8a63d0ff1da7181fc8d1dcb3 100644
--- a/base/test/test_reg_util_win_unittest.cc
+++ b/base/test/test_reg_util_win_unittest.cc
@@ -55,7 +55,7 @@ class RegistryOverrideManagerTest : public testing::Test {
void CreateKey(const base::string16& key_path) {
base::win::RegKey key;
- EXPECT_EQ(ERROR_SUCCESS,
+ ASSERT_EQ(ERROR_SUCCESS,
key.Create(HKEY_CURRENT_USER, key_path.c_str(), KEY_ALL_ACCESS));
}
@@ -74,7 +74,7 @@ class RegistryOverrideManagerTest : public testing::Test {
};
TEST_F(RegistryOverrideManagerTest, Basic) {
- CreateManager(base::Time::Now());
+ ASSERT_NO_FATAL_FAILURE(CreateManager(base::Time::Now()));
base::win::RegKey create_key;
EXPECT_EQ(ERROR_SUCCESS,
@@ -83,7 +83,7 @@ TEST_F(RegistryOverrideManagerTest, Basic) {
EXPECT_EQ(ERROR_SUCCESS, create_key.WriteValue(kTestValueName, 42));
create_key.Close();
- AssertKeyExists(kTestKeyPath);
+ ASSERT_NO_FATAL_FAILURE(AssertKeyExists(kTestKeyPath));
DWORD value;
base::win::RegKey read_key;
@@ -96,7 +96,7 @@ TEST_F(RegistryOverrideManagerTest, Basic) {
manager_.reset();
- AssertKeyAbsent(kTestKeyPath);
+ ASSERT_NO_FATAL_FAILURE(AssertKeyAbsent(kTestKeyPath));
}
TEST_F(RegistryOverrideManagerTest, DeleteStaleKeys) {
@@ -114,20 +114,20 @@ TEST_F(RegistryOverrideManagerTest, DeleteStaleKeys) {
base::string16 path_future =
FakeOverrideManagerPath(kTestTime + base::TimeDelta::FromMinutes(1));
- CreateKey(path_garbage);
- CreateKey(path_very_stale);
- CreateKey(path_stale);
- CreateKey(path_current);
- CreateKey(path_future);
+ ASSERT_NO_FATAL_FAILURE(CreateKey(path_garbage));
+ ASSERT_NO_FATAL_FAILURE(CreateKey(path_very_stale));
+ ASSERT_NO_FATAL_FAILURE(CreateKey(path_stale));
+ ASSERT_NO_FATAL_FAILURE(CreateKey(path_current));
+ ASSERT_NO_FATAL_FAILURE(CreateKey(path_future));
- CreateManager(kTestTime);
+ ASSERT_NO_FATAL_FAILURE(CreateManager(kTestTime));
manager_.reset();
- AssertKeyAbsent(path_garbage);
- AssertKeyAbsent(path_very_stale);
- AssertKeyAbsent(path_stale);
- AssertKeyExists(path_current);
- AssertKeyExists(path_future);
+ ASSERT_NO_FATAL_FAILURE(AssertKeyAbsent(path_garbage));
+ ASSERT_NO_FATAL_FAILURE(AssertKeyAbsent(path_very_stale));
+ ASSERT_NO_FATAL_FAILURE(AssertKeyAbsent(path_stale));
+ ASSERT_NO_FATAL_FAILURE(AssertKeyExists(path_current));
+ ASSERT_NO_FATAL_FAILURE(AssertKeyExists(path_future));
}
} // namespace registry_util
« no previous file with comments | « base/test/test_reg_util_win.cc ('k') | chrome/browser/downgrade/user_data_downgrade_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698