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

Side by Side Diff: chrome/browser/prefs/profile_pref_store_manager_unittest.cc

Issue 684613002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/prefs/profile_pref_store_manager.h" 5 #include "chrome/browser/prefs/profile_pref_store_manager.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class ProfilePrefStoreManagerTest : public testing::Test { 88 class ProfilePrefStoreManagerTest : public testing::Test {
89 public: 89 public:
90 ProfilePrefStoreManagerTest() 90 ProfilePrefStoreManagerTest()
91 : configuration_(kConfiguration, 91 : configuration_(kConfiguration,
92 kConfiguration + arraysize(kConfiguration)), 92 kConfiguration + arraysize(kConfiguration)),
93 profile_pref_registry_(new user_prefs::PrefRegistrySyncable), 93 profile_pref_registry_(new user_prefs::PrefRegistrySyncable),
94 registry_verifier_(profile_pref_registry_.get()), 94 registry_verifier_(profile_pref_registry_.get()),
95 seed_("seed"), 95 seed_("seed"),
96 reset_recorded_(false) {} 96 reset_recorded_(false) {}
97 97
98 virtual void SetUp() override { 98 void SetUp() override {
99 ProfilePrefStoreManager::RegisterPrefs(local_state_.registry()); 99 ProfilePrefStoreManager::RegisterPrefs(local_state_.registry());
100 ProfilePrefStoreManager::RegisterProfilePrefs(profile_pref_registry_.get()); 100 ProfilePrefStoreManager::RegisterProfilePrefs(profile_pref_registry_.get());
101 for (const PrefHashFilter::TrackedPreferenceMetadata* it = kConfiguration; 101 for (const PrefHashFilter::TrackedPreferenceMetadata* it = kConfiguration;
102 it != kConfiguration + arraysize(kConfiguration); 102 it != kConfiguration + arraysize(kConfiguration);
103 ++it) { 103 ++it) {
104 if (it->strategy == PrefHashFilter::TRACKING_STRATEGY_ATOMIC) { 104 if (it->strategy == PrefHashFilter::TRACKING_STRATEGY_ATOMIC) {
105 profile_pref_registry_->RegisterStringPref( 105 profile_pref_registry_->RegisterStringPref(
106 it->name, 106 it->name,
107 std::string(), 107 std::string(),
108 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 108 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
(...skipping 24 matching lines...) Expand all
133 133
134 void ReloadConfiguration() { 134 void ReloadConfiguration() {
135 manager_.reset(new ProfilePrefStoreManager(profile_dir_.path(), 135 manager_.reset(new ProfilePrefStoreManager(profile_dir_.path(),
136 configuration_, 136 configuration_,
137 kReportingIdCount, 137 kReportingIdCount,
138 seed_, 138 seed_,
139 "device_id", 139 "device_id",
140 &local_state_)); 140 &local_state_));
141 } 141 }
142 142
143 virtual void TearDown() override { DestroyPrefStore(); } 143 void TearDown() override { DestroyPrefStore(); }
144 144
145 protected: 145 protected:
146 // Verifies whether a reset was reported via the RecordReset() hook. Also 146 // Verifies whether a reset was reported via the RecordReset() hook. Also
147 // verifies that GetResetTime() was set (or not) accordingly. 147 // verifies that GetResetTime() was set (or not) accordingly.
148 void VerifyResetRecorded(bool reset_expected) { 148 void VerifyResetRecorded(bool reset_expected) {
149 EXPECT_EQ(reset_expected, reset_recorded_); 149 EXPECT_EQ(reset_expected, reset_recorded_);
150 150
151 base::PrefServiceFactory pref_service_factory; 151 base::PrefServiceFactory pref_service_factory;
152 pref_service_factory.set_user_prefs(pref_store_); 152 pref_service_factory.set_user_prefs(pref_store_);
153 153
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 LoadExistingPrefs(); 578 LoadExistingPrefs();
579 ExpectStringValueEquals(kProtectedAtomic, kHelloWorld); 579 ExpectStringValueEquals(kProtectedAtomic, kHelloWorld);
580 580
581 // Trigger the logic that migrates it back to the unprotected preferences 581 // Trigger the logic that migrates it back to the unprotected preferences
582 // file. 582 // file.
583 pref_store_->SetValue(kProtectedAtomic, new base::StringValue(kGoodbyeWorld)); 583 pref_store_->SetValue(kProtectedAtomic, new base::StringValue(kGoodbyeWorld));
584 LoadExistingPrefs(); 584 LoadExistingPrefs();
585 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld); 585 ExpectStringValueEquals(kProtectedAtomic, kGoodbyeWorld);
586 VerifyResetRecorded(false); 586 VerifyResetRecorded(false);
587 } 587 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698