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
3 // found in the LICENSE file.
5 #include "components/content_settings/core/browser/content_settings_pref_provider.h"
7 #include "base/auto_reset.h"
8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h"
11 #include "base/prefs/default_pref_store.h"
12 #include "base/prefs/overlay_user_pref_store.h"
13 #include "base/prefs/pref_change_registrar.h"
14 #include "base/prefs/pref_service.h"
15 #include "base/prefs/scoped_user_pref_update.h"
16 #include "base/prefs/testing_pref_store.h"
17 #include "base/test/simple_test_clock.h"
18 #include "base/threading/platform_thread.h"
19 #include "base/values.h"
20 #include "chrome/browser/content_settings/content_settings_mock_observer.h"
21 #include "chrome/browser/prefs/browser_prefs.h"
22 #include "chrome/common/chrome_switches.h"
23 #include "chrome/common/pref_names.h"
24 #include "chrome/common/url_constants.h"
25 #include "chrome/test/base/testing_profile.h"
26 #include "components/content_settings/core/browser/content_settings_pref.h"
27 #include "components/content_settings/core/browser/content_settings_registry.h"
28 #include "components/content_settings/core/browser/content_settings_rule.h"
29 #include "components/content_settings/core/browser/website_settings_info.h"
30 #include "components/content_settings/core/browser/website_settings_registry.h"
31 #include "components/content_settings/core/common/content_settings_pattern.h"
32 #include "components/content_settings/core/test/content_settings_test_utils.h"
33 #include "components/pref_registry/pref_registry_syncable.h"
34 #include "components/syncable_prefs/pref_service_mock_factory.h"
35 #include "components/syncable_prefs/pref_service_syncable.h"
36 #include "components/syncable_prefs/testing_pref_service_syncable.h"
37 #include "content/public/test/test_browser_thread_bundle.h"
38 #include "testing/gtest/include/gtest/gtest.h"
43 namespace content_settings
{
45 class DeadlockCheckerThread
: public base::PlatformThread::Delegate
{
47 explicit DeadlockCheckerThread(const ContentSettingsPref
* pref
)
50 void ThreadMain() override
{
51 EXPECT_TRUE(pref_
->TryLockForTesting());
54 const ContentSettingsPref
* pref_
;
55 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerThread
);
58 // A helper for observing an preference changes and testing whether
59 // |PrefProvider| holds a lock when the preferences change.
60 class DeadlockCheckerObserver
{
62 // |DeadlockCheckerObserver| doesn't take the ownership of |prefs| or
64 DeadlockCheckerObserver(PrefService
* prefs
, PrefProvider
* provider
)
65 : provider_(provider
),
66 notification_received_(false) {
67 pref_change_registrar_
.Init(prefs
);
68 for (ContentSettingsPref
* pref
: provider_
->content_settings_prefs_
) {
69 pref_change_registrar_
.Add(
72 &DeadlockCheckerObserver::OnContentSettingsPatternPairsChanged
,
73 base::Unretained(this), base::Unretained(pref
)));
76 virtual ~DeadlockCheckerObserver() {}
78 bool notification_received() const {
79 return notification_received_
;
83 void OnContentSettingsPatternPairsChanged(const ContentSettingsPref
* pref
) {
84 // Check whether |provider_| holds its lock. For this, we need a
86 DeadlockCheckerThread
thread(pref
);
87 base::PlatformThreadHandle handle
;
88 ASSERT_TRUE(base::PlatformThread::Create(0, &thread
, &handle
));
89 base::PlatformThread::Join(handle
);
90 notification_received_
= true;
93 PrefProvider
* provider_
;
94 PrefChangeRegistrar pref_change_registrar_
;
95 bool notification_received_
;
96 DISALLOW_COPY_AND_ASSIGN(DeadlockCheckerObserver
);
99 class PrefProviderTest
: public testing::Test
{
102 // Ensure all content settings are initialized.
103 ContentSettingsRegistry::GetInstance();
107 content::TestBrowserThreadBundle thread_bundle_
;
110 TEST_F(PrefProviderTest
, Observer
) {
111 TestingProfile profile
;
112 PrefProvider
pref_content_settings_provider(profile
.GetPrefs(), false);
114 ContentSettingsPattern pattern
=
115 ContentSettingsPattern::FromString("[*.]example.com");
116 MockObserver mock_observer
;
117 EXPECT_CALL(mock_observer
,
118 OnContentSettingChanged(pattern
,
119 ContentSettingsPattern::Wildcard(),
120 CONTENT_SETTINGS_TYPE_IMAGES
,
123 pref_content_settings_provider
.AddObserver(&mock_observer
);
125 pref_content_settings_provider
.SetWebsiteSetting(
127 ContentSettingsPattern::Wildcard(),
128 CONTENT_SETTINGS_TYPE_IMAGES
,
130 new base::FundamentalValue(CONTENT_SETTING_ALLOW
));
132 pref_content_settings_provider
.ShutdownOnUIThread();
135 // Test for regression in which the PrefProvider modified the user pref store
136 // of the OTR unintentionally: http://crbug.com/74466.
137 TEST_F(PrefProviderTest
, Incognito
) {
138 PersistentPrefStore
* user_prefs
= new TestingPrefStore();
139 OverlayUserPrefStore
* otr_user_prefs
=
140 new OverlayUserPrefStore(user_prefs
);
142 syncable_prefs::PrefServiceMockFactory factory
;
143 factory
.set_user_prefs(make_scoped_refptr(user_prefs
));
144 scoped_refptr
<user_prefs::PrefRegistrySyncable
> registry(
145 new user_prefs::PrefRegistrySyncable
);
146 syncable_prefs::PrefServiceSyncable
* regular_prefs
=
147 factory
.CreateSyncable(registry
.get()).release();
149 chrome::RegisterUserProfilePrefs(registry
.get());
151 syncable_prefs::PrefServiceMockFactory otr_factory
;
152 otr_factory
.set_user_prefs(make_scoped_refptr(otr_user_prefs
));
153 scoped_refptr
<user_prefs::PrefRegistrySyncable
> otr_registry(
154 new user_prefs::PrefRegistrySyncable
);
155 syncable_prefs::PrefServiceSyncable
* otr_prefs
=
156 otr_factory
.CreateSyncable(otr_registry
.get()).release();
158 chrome::RegisterUserProfilePrefs(otr_registry
.get());
160 TestingProfile::Builder profile_builder
;
161 profile_builder
.SetPrefService(make_scoped_ptr(regular_prefs
));
162 scoped_ptr
<TestingProfile
> profile
= profile_builder
.Build();
164 TestingProfile::Builder otr_profile_builder
;
165 otr_profile_builder
.SetPrefService(make_scoped_ptr(otr_prefs
));
166 otr_profile_builder
.BuildIncognito(profile
.get());
168 PrefProvider
pref_content_settings_provider(regular_prefs
, false);
169 PrefProvider
pref_content_settings_provider_incognito(otr_prefs
, true);
170 ContentSettingsPattern pattern
=
171 ContentSettingsPattern::FromString("[*.]example.com");
172 pref_content_settings_provider
.SetWebsiteSetting(
175 CONTENT_SETTINGS_TYPE_IMAGES
,
177 new base::FundamentalValue(CONTENT_SETTING_ALLOW
));
179 GURL
host("http://example.com/");
180 // The value should of course be visible in the regular PrefProvider.
181 EXPECT_EQ(CONTENT_SETTING_ALLOW
,
182 GetContentSetting(&pref_content_settings_provider
,
185 CONTENT_SETTINGS_TYPE_IMAGES
,
188 // And also in the OTR version.
189 EXPECT_EQ(CONTENT_SETTING_ALLOW
,
190 GetContentSetting(&pref_content_settings_provider_incognito
,
193 CONTENT_SETTINGS_TYPE_IMAGES
,
196 const WebsiteSettingsInfo
* info
=
197 WebsiteSettingsRegistry::GetInstance()->Get(CONTENT_SETTINGS_TYPE_IMAGES
);
198 // But the value should not be overridden in the OTR user prefs accidentally.
199 EXPECT_FALSE(otr_user_prefs
->IsSetInOverlay(info
->pref_name()));
201 pref_content_settings_provider
.ShutdownOnUIThread();
202 pref_content_settings_provider_incognito
.ShutdownOnUIThread();
205 TEST_F(PrefProviderTest
, GetContentSettingsValue
) {
206 TestingProfile testing_profile
;
207 PrefProvider
provider(testing_profile
.GetPrefs(), false);
209 GURL
primary_url("http://example.com/");
210 ContentSettingsPattern primary_pattern
=
211 ContentSettingsPattern::FromString("[*.]example.com");
213 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
214 GetContentSetting(&provider
,
217 CONTENT_SETTINGS_TYPE_IMAGES
,
222 GetContentSettingValue(&provider
,
225 CONTENT_SETTINGS_TYPE_IMAGES
,
229 provider
.SetWebsiteSetting(primary_pattern
,
231 CONTENT_SETTINGS_TYPE_IMAGES
,
233 new base::FundamentalValue(CONTENT_SETTING_BLOCK
));
234 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
235 GetContentSetting(&provider
,
238 CONTENT_SETTINGS_TYPE_IMAGES
,
241 scoped_ptr
<base::Value
> value_ptr(
242 GetContentSettingValue(&provider
,
245 CONTENT_SETTINGS_TYPE_IMAGES
,
249 value_ptr
->GetAsInteger(&int_value
);
250 EXPECT_EQ(CONTENT_SETTING_BLOCK
, IntToContentSetting(int_value
));
252 provider
.SetWebsiteSetting(primary_pattern
,
254 CONTENT_SETTINGS_TYPE_IMAGES
,
258 GetContentSettingValue(&provider
,
261 CONTENT_SETTINGS_TYPE_IMAGES
,
264 provider
.ShutdownOnUIThread();
267 TEST_F(PrefProviderTest
, Patterns
) {
268 TestingProfile testing_profile
;
269 PrefProvider
pref_content_settings_provider(testing_profile
.GetPrefs(),
272 GURL
host1("http://example.com/");
273 GURL
host2("http://www.example.com/");
274 GURL
host3("http://example.org/");
275 GURL
host4("file:///tmp/test.html");
276 ContentSettingsPattern pattern1
=
277 ContentSettingsPattern::FromString("[*.]example.com");
278 ContentSettingsPattern pattern2
=
279 ContentSettingsPattern::FromString("example.org");
280 ContentSettingsPattern pattern3
=
281 ContentSettingsPattern::FromString("file:///tmp/test.html");
283 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
284 GetContentSetting(&pref_content_settings_provider
,
287 CONTENT_SETTINGS_TYPE_IMAGES
,
290 pref_content_settings_provider
.SetWebsiteSetting(
293 CONTENT_SETTINGS_TYPE_IMAGES
,
295 new base::FundamentalValue(CONTENT_SETTING_BLOCK
));
296 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
297 GetContentSetting(&pref_content_settings_provider
,
300 CONTENT_SETTINGS_TYPE_IMAGES
,
303 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
304 GetContentSetting(&pref_content_settings_provider
,
307 CONTENT_SETTINGS_TYPE_IMAGES
,
311 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
312 GetContentSetting(&pref_content_settings_provider
,
315 CONTENT_SETTINGS_TYPE_IMAGES
,
318 pref_content_settings_provider
.SetWebsiteSetting(
321 CONTENT_SETTINGS_TYPE_IMAGES
,
323 new base::FundamentalValue(CONTENT_SETTING_BLOCK
));
324 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
325 GetContentSetting(&pref_content_settings_provider
,
328 CONTENT_SETTINGS_TYPE_IMAGES
,
332 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
333 GetContentSetting(&pref_content_settings_provider
,
336 CONTENT_SETTINGS_TYPE_IMAGES
,
339 pref_content_settings_provider
.SetWebsiteSetting(
342 CONTENT_SETTINGS_TYPE_IMAGES
,
344 new base::FundamentalValue(CONTENT_SETTING_BLOCK
));
345 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
346 GetContentSetting(&pref_content_settings_provider
,
349 CONTENT_SETTINGS_TYPE_IMAGES
,
353 pref_content_settings_provider
.ShutdownOnUIThread();
356 TEST_F(PrefProviderTest
, ResourceIdentifier
) {
357 TestingProfile testing_profile
;
358 PrefProvider
pref_content_settings_provider(testing_profile
.GetPrefs(),
361 GURL
host("http://example.com/");
362 ContentSettingsPattern pattern
=
363 ContentSettingsPattern::FromString("[*.]example.com");
364 std::string
resource1("someplugin");
365 std::string
resource2("otherplugin");
367 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
369 &pref_content_settings_provider
,
370 host
, host
, CONTENT_SETTINGS_TYPE_PLUGINS
,
372 pref_content_settings_provider
.SetWebsiteSetting(
375 CONTENT_SETTINGS_TYPE_PLUGINS
,
377 new base::FundamentalValue(CONTENT_SETTING_BLOCK
));
378 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
380 &pref_content_settings_provider
,
381 host
, host
, CONTENT_SETTINGS_TYPE_PLUGINS
,
383 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
385 &pref_content_settings_provider
,
386 host
, host
, CONTENT_SETTINGS_TYPE_PLUGINS
,
389 pref_content_settings_provider
.ShutdownOnUIThread();
392 TEST_F(PrefProviderTest
, AutoSubmitCertificateContentSetting
) {
393 TestingProfile profile
;
394 syncable_prefs::TestingPrefServiceSyncable
* prefs
=
395 profile
.GetTestingPrefService();
396 GURL
primary_url("https://www.example.com");
397 GURL
secondary_url("https://www.sample.com");
399 PrefProvider
provider(prefs
, false);
401 EXPECT_EQ(CONTENT_SETTING_DEFAULT
,
406 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE
,
410 provider
.SetWebsiteSetting(ContentSettingsPattern::FromURL(primary_url
),
411 ContentSettingsPattern::Wildcard(),
412 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE
,
414 new base::FundamentalValue(CONTENT_SETTING_ALLOW
));
415 EXPECT_EQ(CONTENT_SETTING_ALLOW
,
420 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE
,
423 provider
.ShutdownOnUIThread();
426 // http://crosbug.com/17760
427 TEST_F(PrefProviderTest
, Deadlock
) {
428 syncable_prefs::TestingPrefServiceSyncable prefs
;
429 PrefProvider::RegisterProfilePrefs(prefs
.registry());
431 // Chain of events: a preference changes, |PrefProvider| notices it, and reads
432 // and writes the preference. When the preference is written, a notification
433 // is sent, and this used to happen when |PrefProvider| was still holding its
436 const WebsiteSettingsInfo
* info
=
437 WebsiteSettingsRegistry::GetInstance()->Get(CONTENT_SETTINGS_TYPE_IMAGES
);
438 PrefProvider
provider(&prefs
, false);
439 DeadlockCheckerObserver
observer(&prefs
, &provider
);
441 DictionaryPrefUpdate
update(&prefs
, info
->pref_name());
442 base::DictionaryValue
* mutable_settings
= update
.Get();
443 mutable_settings
->SetWithoutPathExpansion("www.example.com,*",
444 new base::DictionaryValue());
446 EXPECT_TRUE(observer
.notification_received());
448 provider
.ShutdownOnUIThread();
451 TEST_F(PrefProviderTest
, LastUsage
) {
452 TestingProfile testing_profile
;
453 PrefProvider
pref_content_settings_provider(testing_profile
.GetPrefs(),
455 base::SimpleTestClock
* test_clock
= new base::SimpleTestClock
;
456 test_clock
->SetNow(base::Time::Now());
458 pref_content_settings_provider
.SetClockForTesting(
459 scoped_ptr
<base::Clock
>(test_clock
));
460 GURL
host("http://example.com/");
461 ContentSettingsPattern pattern
=
462 ContentSettingsPattern::FromString("[*.]example.com");
464 base::Time no_usage
= pref_content_settings_provider
.GetLastUsage(
465 pattern
, pattern
, CONTENT_SETTINGS_TYPE_GEOLOCATION
);
466 EXPECT_EQ(no_usage
.ToDoubleT(), 0);
468 pref_content_settings_provider
.UpdateLastUsage(
469 pattern
, pattern
, CONTENT_SETTINGS_TYPE_GEOLOCATION
);
470 base::Time first
= pref_content_settings_provider
.GetLastUsage(
471 pattern
, pattern
, CONTENT_SETTINGS_TYPE_GEOLOCATION
);
473 test_clock
->Advance(base::TimeDelta::FromSeconds(10));
475 pref_content_settings_provider
.UpdateLastUsage(
476 pattern
, pattern
, CONTENT_SETTINGS_TYPE_GEOLOCATION
);
477 base::Time second
= pref_content_settings_provider
.GetLastUsage(
478 pattern
, pattern
, CONTENT_SETTINGS_TYPE_GEOLOCATION
);
480 base::TimeDelta delta
= second
- first
;
481 EXPECT_EQ(delta
.InSeconds(), 10);
483 pref_content_settings_provider
.ShutdownOnUIThread();
486 TEST_F(PrefProviderTest
, IncognitoInheritsValueMap
) {
487 syncable_prefs::TestingPrefServiceSyncable prefs
;
488 PrefProvider::RegisterProfilePrefs(prefs
.registry());
490 ContentSettingsPattern pattern_1
=
491 ContentSettingsPattern::FromString("google.com");
492 ContentSettingsPattern pattern_2
=
493 ContentSettingsPattern::FromString("www.google.com");
494 ContentSettingsPattern wildcard
=
495 ContentSettingsPattern::FromString("*");
496 scoped_ptr
<base::Value
> value(
497 new base::FundamentalValue(CONTENT_SETTING_ALLOW
));
499 // Create a normal provider and set a setting.
500 PrefProvider
normal_provider(&prefs
, false);
501 normal_provider
.SetWebsiteSetting(pattern_1
,
503 CONTENT_SETTINGS_TYPE_IMAGES
,
507 // Non-OTR provider, Non-OTR iterator has one setting (pattern 1).
509 scoped_ptr
<RuleIterator
> it(normal_provider
.GetRuleIterator(
510 CONTENT_SETTINGS_TYPE_IMAGES
, std::string(), false));
511 EXPECT_TRUE(it
->HasNext());
512 EXPECT_EQ(pattern_1
, it
->Next().primary_pattern
);
513 EXPECT_FALSE(it
->HasNext());
516 // Non-OTR provider, OTR iterator has no settings.
518 scoped_ptr
<RuleIterator
> it(normal_provider
.GetRuleIterator(
519 CONTENT_SETTINGS_TYPE_IMAGES
, std::string(), true));
520 EXPECT_FALSE(it
->HasNext());
523 // Create an incognito provider and set a setting.
524 PrefProvider
incognito_provider(&prefs
, true);
525 incognito_provider
.SetWebsiteSetting(pattern_2
,
527 CONTENT_SETTINGS_TYPE_IMAGES
,
531 // OTR provider, non-OTR iterator has one setting (pattern 1).
533 scoped_ptr
<RuleIterator
> it(incognito_provider
.GetRuleIterator(
534 CONTENT_SETTINGS_TYPE_IMAGES
, std::string(), false));
535 EXPECT_TRUE(it
->HasNext());
536 EXPECT_EQ(pattern_1
, it
->Next().primary_pattern
);
537 EXPECT_FALSE(it
->HasNext());
540 // OTR provider, OTR iterator has one setting (pattern 2).
542 scoped_ptr
<RuleIterator
> it(incognito_provider
.GetRuleIterator(
543 CONTENT_SETTINGS_TYPE_IMAGES
, std::string(), true));
544 EXPECT_TRUE(it
->HasNext());
545 EXPECT_EQ(pattern_2
, it
->Next().primary_pattern
);
546 EXPECT_FALSE(it
->HasNext());
549 incognito_provider
.ShutdownOnUIThread();
550 normal_provider
.ShutdownOnUIThread();
553 TEST_F(PrefProviderTest
, ClearAllContentSettingsRules
) {
554 syncable_prefs::TestingPrefServiceSyncable prefs
;
555 PrefProvider::RegisterProfilePrefs(prefs
.registry());
557 ContentSettingsPattern pattern
=
558 ContentSettingsPattern::FromString("google.com");
559 ContentSettingsPattern wildcard
=
560 ContentSettingsPattern::FromString("*");
561 scoped_ptr
<base::Value
> value(
562 new base::FundamentalValue(CONTENT_SETTING_ALLOW
));
563 ResourceIdentifier
res_id("abcde");
565 PrefProvider
provider(&prefs
, false);
567 // Non-empty pattern, syncable, empty resource identifier.
568 provider
.SetWebsiteSetting(pattern
, wildcard
, CONTENT_SETTINGS_TYPE_IMAGES
,
569 ResourceIdentifier(), value
->DeepCopy());
571 // Non-empty pattern, non-syncable, empty resource identifier.
572 provider
.SetWebsiteSetting(pattern
, wildcard
,
573 CONTENT_SETTINGS_TYPE_GEOLOCATION
,
574 ResourceIdentifier(), value
->DeepCopy());
576 // Non-empty pattern, plugins, non-empty resource identifier.
577 provider
.SetWebsiteSetting(pattern
, wildcard
, CONTENT_SETTINGS_TYPE_PLUGINS
,
578 res_id
, value
->DeepCopy());
580 // Empty pattern, plugins, non-empty resource identifier.
581 provider
.SetWebsiteSetting(wildcard
, wildcard
, CONTENT_SETTINGS_TYPE_PLUGINS
,
582 res_id
, value
->DeepCopy());
584 // Non-empty pattern, syncable, empty resource identifier.
585 provider
.SetWebsiteSetting(pattern
, wildcard
, CONTENT_SETTINGS_TYPE_COOKIES
,
586 ResourceIdentifier(), value
->DeepCopy());
588 // Non-empty pattern, non-syncable, empty resource identifier.
589 provider
.SetWebsiteSetting(pattern
, wildcard
,
590 CONTENT_SETTINGS_TYPE_NOTIFICATIONS
,
591 ResourceIdentifier(), value
->DeepCopy());
593 provider
.ClearAllContentSettingsRules(CONTENT_SETTINGS_TYPE_IMAGES
);
594 provider
.ClearAllContentSettingsRules(CONTENT_SETTINGS_TYPE_GEOLOCATION
);
595 provider
.ClearAllContentSettingsRules(CONTENT_SETTINGS_TYPE_PLUGINS
);
597 WebsiteSettingsRegistry
* registry
= WebsiteSettingsRegistry::GetInstance();
598 // Test that the preferences for images, geolocation and plugins are empty.
599 const char* empty_prefs
[] = {
600 registry
->Get(CONTENT_SETTINGS_TYPE_IMAGES
)->pref_name().c_str(),
601 registry
->Get(CONTENT_SETTINGS_TYPE_GEOLOCATION
)->pref_name().c_str(),
602 registry
->Get(CONTENT_SETTINGS_TYPE_PLUGINS
)->pref_name().c_str(),
605 for (const char* pref
: empty_prefs
) {
606 DictionaryPrefUpdate
update(&prefs
, pref
);
607 const base::DictionaryValue
* dictionary
= update
.Get();
608 EXPECT_TRUE(dictionary
->empty());
611 // Test that the preferences for cookies and notifications are not empty.
612 const char* nonempty_prefs
[] = {
613 registry
->Get(CONTENT_SETTINGS_TYPE_COOKIES
)->pref_name().c_str(),
614 registry
->Get(CONTENT_SETTINGS_TYPE_NOTIFICATIONS
)->pref_name().c_str(),
617 for (const char* pref
: nonempty_prefs
) {
618 DictionaryPrefUpdate
update(&prefs
, pref
);
619 const base::DictionaryValue
* dictionary
= update
.Get();
620 EXPECT_EQ(1u, dictionary
->size());
623 provider
.ShutdownOnUIThread();
626 } // namespace content_settings