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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory ownership bug in ProxyPolicyTest Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
index 901776ef0b68bfa676a7b530e687751a83b11132..bdea038651e3358ace04df140df7e1122d54f513 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/content_settings/content_settings_mock_observer.h"
#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/prefs/browser_prefs.h"
-#include "chrome/browser/prefs/pref_service_mock_builder.h"
+#include "chrome/browser/prefs/pref_service_mock_factory.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -134,18 +134,21 @@ TEST_F(PrefProviderTest, Incognito) {
OverlayUserPrefStore* otr_user_prefs =
new OverlayUserPrefStore(user_prefs);
- PrefServiceMockBuilder builder;
- builder.WithUserPrefs(user_prefs);
+ PrefServiceMockFactory factory;
+ factory.set_user_prefs(make_scoped_refptr(user_prefs));
scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
new user_prefs::PrefRegistrySyncable);
- PrefServiceSyncable* regular_prefs = builder.CreateSyncable(registry.get());
+ PrefServiceSyncable* regular_prefs =
+ factory.CreateSyncable(registry.get()).release();
chrome::RegisterUserProfilePrefs(registry.get());
- builder.WithUserPrefs(otr_user_prefs);
+ PrefServiceMockFactory otr_factory;
+ otr_factory.set_user_prefs(make_scoped_refptr(otr_user_prefs));
scoped_refptr<user_prefs::PrefRegistrySyncable> otr_registry(
new user_prefs::PrefRegistrySyncable);
- PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry.get());
+ PrefServiceSyncable* otr_prefs =
+ otr_factory.CreateSyncable(otr_registry.get()).release();
chrome::RegisterUserProfilePrefs(otr_registry.get());

Powered by Google App Engine
This is Rietveld 408576698