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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc

Issue 2615403002: Added extension controlled prefs to TestingPrefService (Closed)
Patch Set: Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/safe_browsing/incident_reporting/platform_state_store.h " 5 #include "chrome/browser/safe_browsing/incident_reporting/platform_state_store.h "
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 TestingPrefStore* user_pref_store = new TestingPrefStore(); 57 TestingPrefStore* user_pref_store = new TestingPrefStore();
58 // Profile::IsNewProfile() returns true/false on the basis of the pref 58 // Profile::IsNewProfile() returns true/false on the basis of the pref
59 // store's read_error property. A profile is considered "New" if it didn't 59 // store's read_error property. A profile is considered "New" if it didn't
60 // have a user prefs file. 60 // have a user prefs file.
61 user_pref_store->set_read_error( 61 user_pref_store->set_read_error(
62 new_profile ? PersistentPrefStore::PREF_READ_ERROR_NO_FILE 62 new_profile ? PersistentPrefStore::PREF_READ_ERROR_NO_FILE
63 : PersistentPrefStore::PREF_READ_ERROR_NONE); 63 : PersistentPrefStore::PREF_READ_ERROR_NONE);
64 // Ownership of |user_pref_store| is passed to the service. 64 // Ownership of |user_pref_store| is passed to the service.
65 std::unique_ptr<sync_preferences::TestingPrefServiceSyncable> prefs( 65 std::unique_ptr<sync_preferences::TestingPrefServiceSyncable> prefs(
66 new sync_preferences::TestingPrefServiceSyncable( 66 new sync_preferences::TestingPrefServiceSyncable(
67 new TestingPrefStore(), user_pref_store, new TestingPrefStore(), 67 new TestingPrefStore(), new TestingPrefStore(), user_pref_store,
68 new user_prefs::PrefRegistrySyncable(), new PrefNotifierImpl())); 68 new TestingPrefStore(), new user_prefs::PrefRegistrySyncable(),
69 new PrefNotifierImpl()));
69 chrome::RegisterUserProfilePrefs(prefs->registry()); 70 chrome::RegisterUserProfilePrefs(prefs->registry());
70 profile_ = profile_manager_.CreateTestingProfile( 71 profile_ = profile_manager_.CreateTestingProfile(
71 kProfileName_, std::move(prefs), base::UTF8ToUTF16(kProfileName_), 0, 72 kProfileName_, std::move(prefs), base::UTF8ToUTF16(kProfileName_), 0,
72 std::string(), TestingProfile::TestingFactories()); 73 std::string(), TestingProfile::TestingFactories());
73 if (new_profile) 74 if (new_profile)
74 ASSERT_TRUE(profile_->IsNewProfile()); 75 ASSERT_TRUE(profile_->IsNewProfile());
75 else 76 else
76 ASSERT_FALSE(profile_->IsNewProfile()); 77 ASSERT_FALSE(profile_->IsNewProfile());
77 } 78 }
78 79
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 175
175 std::string data; 176 std::string data;
176 PlatformStateStoreLoadResult result = ReadStoreData(profile_, &data); 177 PlatformStateStoreLoadResult result = ReadStoreData(profile_, &data);
177 EXPECT_EQ(PlatformStateStoreLoadResult::CLEARED_DATA, result); 178 EXPECT_EQ(PlatformStateStoreLoadResult::CLEARED_DATA, result);
178 EXPECT_EQ(std::string(), data); 179 EXPECT_EQ(std::string(), data);
179 AssertTestDataIsAbsent(); 180 AssertTestDataIsAbsent();
180 } 181 }
181 182
182 } // namespace platform_state_store 183 } // namespace platform_state_store
183 } // namespace safe_browsing 184 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698