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

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

Issue 11968032: Move 'theme' parsing out of Extension class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed IncognitoAutofillManagerTest unittest Created 7 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) 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 Profile::RegisterUserPrefs(registry); 142 Profile::RegisterUserPrefs(registry);
143 chrome::RegisterUserPrefs(regular_prefs, registry); 143 chrome::RegisterUserPrefs(regular_prefs, registry);
144 144
145 builder.WithUserPrefs(otr_user_prefs); 145 builder.WithUserPrefs(otr_user_prefs);
146 scoped_refptr<PrefRegistrySyncable> otr_registry(new PrefRegistrySyncable); 146 scoped_refptr<PrefRegistrySyncable> otr_registry(new PrefRegistrySyncable);
147 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry); 147 PrefServiceSyncable* otr_prefs = builder.CreateSyncable(otr_registry);
148 148
149 Profile::RegisterUserPrefs(otr_registry); 149 Profile::RegisterUserPrefs(otr_registry);
150 chrome::RegisterUserPrefs(otr_prefs, otr_registry); 150 chrome::RegisterUserPrefs(otr_prefs, otr_registry);
151 151
152 TestingProfile profile; 152 TestingProfile::Builder profile_builder;
153 TestingProfile* otr_profile = new TestingProfile; 153 profile_builder.SetPrefService(make_scoped_ptr(regular_prefs));
154 profile.SetOffTheRecordProfile(otr_profile); 154 scoped_ptr<TestingProfile> profile = profile_builder.Build();
155 profile.SetPrefService(regular_prefs); 155
156 TestingProfile::Builder otr_profile_builder;
157 otr_profile_builder.SetPrefService(make_scoped_ptr(otr_prefs));
158 TestingProfile* otr_profile = otr_profile_builder.Build().release();
159
156 otr_profile->set_incognito(true); 160 otr_profile->set_incognito(true);
157 otr_profile->SetPrefService(otr_prefs); 161 profile->SetOffTheRecordProfile(otr_profile);
158 162
159 PrefProvider pref_content_settings_provider(regular_prefs, false); 163 PrefProvider pref_content_settings_provider(regular_prefs, false);
160 PrefProvider pref_content_settings_provider_incognito(otr_prefs, true); 164 PrefProvider pref_content_settings_provider_incognito(otr_prefs, true);
161 ContentSettingsPattern pattern = 165 ContentSettingsPattern pattern =
162 ContentSettingsPattern::FromString("[*.]example.com"); 166 ContentSettingsPattern::FromString("[*.]example.com");
163 pref_content_settings_provider.SetWebsiteSetting( 167 pref_content_settings_provider.SetWebsiteSetting(
164 pattern, 168 pattern,
165 pattern, 169 pattern,
166 CONTENT_SETTINGS_TYPE_IMAGES, 170 CONTENT_SETTINGS_TYPE_IMAGES,
167 "", 171 "",
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 DictionaryValue* mutable_settings = update.Get(); 391 DictionaryValue* mutable_settings = update.Get();
388 mutable_settings->SetWithoutPathExpansion("www.example.com,*", 392 mutable_settings->SetWithoutPathExpansion("www.example.com,*",
389 new base::DictionaryValue()); 393 new base::DictionaryValue());
390 } 394 }
391 EXPECT_TRUE(observer.notification_received()); 395 EXPECT_TRUE(observer.notification_received());
392 396
393 provider.ShutdownOnUIThread(); 397 provider.ShutdownOnUIThread();
394 } 398 }
395 399
396 } // namespace content_settings 400 } // namespace content_settings
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/themes/browser_theme_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698