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

Side by Side Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 12315116: Add ability to change default pref values, and use in BrowserInstantController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR and address review nit. Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « base/prefs/pref_service.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/content_settings/content_settings_pref_provider.h" 5 #include "chrome/browser/content_settings/content_settings_pref_provider.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 TEST_F(PrefProviderTest, Incognito) { 132 TEST_F(PrefProviderTest, Incognito) {
133 PersistentPrefStore* user_prefs = new TestingPrefStore(); 133 PersistentPrefStore* user_prefs = new TestingPrefStore();
134 OverlayUserPrefStore* otr_user_prefs = 134 OverlayUserPrefStore* otr_user_prefs =
135 new OverlayUserPrefStore(user_prefs); 135 new OverlayUserPrefStore(user_prefs);
136 136
137 PrefServiceMockBuilder builder; 137 PrefServiceMockBuilder builder;
138 builder.WithUserPrefs(user_prefs); 138 builder.WithUserPrefs(user_prefs);
139 scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable); 139 scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable);
140 PrefServiceSyncable* regular_prefs = builder.CreateSyncable(registry); 140 PrefServiceSyncable* regular_prefs = builder.CreateSyncable(registry);
141 141
142 chrome::RegisterUserPrefs(regular_prefs, registry); 142 chrome::RegisterUserPrefs(registry);
143 143
144 builder.WithUserPrefs(otr_user_prefs); 144 builder.WithUserPrefs(otr_user_prefs);
145 scoped_refptr<PrefRegistrySyncable> otr_registry(new PrefRegistrySyncable); 145 scoped_refptr<PrefRegistrySyncable> otr_registry(new PrefRegistrySyncable);
146 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry); 146 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry);
147 147
148 chrome::RegisterUserPrefs(otr_prefs, otr_registry); 148 chrome::RegisterUserPrefs(otr_registry);
149 149
150 TestingProfile::Builder profile_builder; 150 TestingProfile::Builder profile_builder;
151 profile_builder.SetPrefService(make_scoped_ptr(regular_prefs)); 151 profile_builder.SetPrefService(make_scoped_ptr(regular_prefs));
152 scoped_ptr<TestingProfile> profile = profile_builder.Build(); 152 scoped_ptr<TestingProfile> profile = profile_builder.Build();
153 153
154 TestingProfile::Builder otr_profile_builder; 154 TestingProfile::Builder otr_profile_builder;
155 otr_profile_builder.SetPrefService(make_scoped_ptr(otr_prefs)); 155 otr_profile_builder.SetPrefService(make_scoped_ptr(otr_prefs));
156 TestingProfile* otr_profile = otr_profile_builder.Build().release(); 156 TestingProfile* otr_profile = otr_profile_builder.Build().release();
157 157
158 otr_profile->set_incognito(true); 158 otr_profile->set_incognito(true);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 DictionaryValue* mutable_settings = update.Get(); 389 DictionaryValue* mutable_settings = update.Get();
390 mutable_settings->SetWithoutPathExpansion("www.example.com,*", 390 mutable_settings->SetWithoutPathExpansion("www.example.com,*",
391 new base::DictionaryValue()); 391 new base::DictionaryValue());
392 } 392 }
393 EXPECT_TRUE(observer.notification_received()); 393 EXPECT_TRUE(observer.notification_received());
394 394
395 provider.ShutdownOnUIThread(); 395 provider.ShutdownOnUIThread();
396 } 396 }
397 397
398 } // namespace content_settings 398 } // namespace content_settings
OLDNEW
« no previous file with comments | « base/prefs/pref_service.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698