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

Side by Side Diff: components/user_prefs/tracked/registry_hash_store_contents_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/user_prefs/tracked/registry_hash_store_contents_win.h" 5 #include "components/user_prefs/tracked/registry_hash_store_contents_win.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/test/test_reg_util_win.h" 9 #include "base/test/test_reg_util_win.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 12 matching lines...) Expand all
23 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; 23 "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
24 24
25 constexpr char kAtomicPrefPath[] = "path1"; 25 constexpr char kAtomicPrefPath[] = "path1";
26 constexpr char kSplitPrefPath[] = "extension"; 26 constexpr char kSplitPrefPath[] = "extension";
27 27
28 class RegistryHashStoreContentsWinTest : public testing::Test { 28 class RegistryHashStoreContentsWinTest : public testing::Test {
29 protected: 29 protected:
30 RegistryHashStoreContentsWinTest() {} 30 RegistryHashStoreContentsWinTest() {}
31 31
32 void SetUp() override { 32 void SetUp() override {
33 registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER); 33 ASSERT_NO_FATAL_FAILURE(
34 registry_override_manager_.OverrideRegistry(HKEY_CURRENT_USER));
34 35
35 contents.reset(new RegistryHashStoreContentsWin(kRegistryPath, kStoreKey)); 36 contents.reset(new RegistryHashStoreContentsWin(kRegistryPath, kStoreKey));
36 } 37 }
37 38
38 std::unique_ptr<HashStoreContents> contents; 39 std::unique_ptr<HashStoreContents> contents;
39 40
40 private: 41 private:
41 registry_util::RegistryOverrideManager registry_override_manager_; 42 registry_util::RegistryOverrideManager registry_override_manager_;
42 43
43 DISALLOW_COPY_AND_ASSIGN(RegistryHashStoreContentsWinTest); 44 DISALLOW_COPY_AND_ASSIGN(RegistryHashStoreContentsWinTest);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 contents->Reset(); 111 contents->Reset();
111 112
112 stored_mac.clear(); 113 stored_mac.clear();
113 EXPECT_FALSE(contents->GetMac(kAtomicPrefPath, &stored_mac)); 114 EXPECT_FALSE(contents->GetMac(kAtomicPrefPath, &stored_mac));
114 EXPECT_TRUE(stored_mac.empty()); 115 EXPECT_TRUE(stored_mac.empty());
115 116
116 split_macs.clear(); 117 split_macs.clear();
117 EXPECT_FALSE(contents->GetSplitMacs(kSplitPrefPath, &split_macs)); 118 EXPECT_FALSE(contents->GetSplitMacs(kSplitPrefPath, &split_macs));
118 EXPECT_EQ(0U, split_macs.size()); 119 EXPECT_EQ(0U, split_macs.size());
119 } 120 }
OLDNEW
« no previous file with comments | « components/browser_watcher/watcher_metrics_provider_win_unittest.cc ('k') | rlz/test/rlz_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698