| OLD | NEW |
| 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 "components/content_settings/core/browser/content_settings_pref_provide
r.h" | 5 #include "components/content_settings/core/browser/content_settings_pref_provide
r.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 // is sent, and this used to happen when |PrefProvider| was still holding its | 442 // is sent, and this used to happen when |PrefProvider| was still holding its |
| 443 // lock. | 443 // lock. |
| 444 | 444 |
| 445 const WebsiteSettingsInfo* info = WebsiteSettingsRegistry::GetInstance()->Get( | 445 const WebsiteSettingsInfo* info = WebsiteSettingsRegistry::GetInstance()->Get( |
| 446 CONTENT_SETTINGS_TYPE_COOKIES); | 446 CONTENT_SETTINGS_TYPE_COOKIES); |
| 447 PrefProvider provider(&prefs, false); | 447 PrefProvider provider(&prefs, false); |
| 448 DeadlockCheckerObserver observer(&prefs, &provider); | 448 DeadlockCheckerObserver observer(&prefs, &provider); |
| 449 { | 449 { |
| 450 DictionaryPrefUpdate update(&prefs, info->pref_name()); | 450 DictionaryPrefUpdate update(&prefs, info->pref_name()); |
| 451 base::DictionaryValue* mutable_settings = update.Get(); | 451 base::DictionaryValue* mutable_settings = update.Get(); |
| 452 mutable_settings->SetWithoutPathExpansion("www.example.com,*", | 452 mutable_settings->SetWithoutPathExpansion( |
| 453 new base::DictionaryValue()); | 453 "www.example.com,*", base::MakeUnique<base::DictionaryValue>()); |
| 454 } | 454 } |
| 455 EXPECT_TRUE(observer.notification_received()); | 455 EXPECT_TRUE(observer.notification_received()); |
| 456 | 456 |
| 457 provider.ShutdownOnUIThread(); | 457 provider.ShutdownOnUIThread(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 TEST_F(PrefProviderTest, IncognitoInheritsValueMap) { | 460 TEST_F(PrefProviderTest, IncognitoInheritsValueMap) { |
| 461 sync_preferences::TestingPrefServiceSyncable prefs; | 461 sync_preferences::TestingPrefServiceSyncable prefs; |
| 462 PrefProvider::RegisterProfilePrefs(prefs.registry()); | 462 PrefProvider::RegisterProfilePrefs(prefs.registry()); |
| 463 | 463 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 for (const char* pref : nonempty_prefs) { | 590 for (const char* pref : nonempty_prefs) { |
| 591 DictionaryPrefUpdate update(&prefs, pref); | 591 DictionaryPrefUpdate update(&prefs, pref); |
| 592 const base::DictionaryValue* dictionary = update.Get(); | 592 const base::DictionaryValue* dictionary = update.Get(); |
| 593 EXPECT_EQ(1u, dictionary->size()); | 593 EXPECT_EQ(1u, dictionary->size()); |
| 594 } | 594 } |
| 595 | 595 |
| 596 provider.ShutdownOnUIThread(); | 596 provider.ShutdownOnUIThread(); |
| 597 } | 597 } |
| 598 | 598 |
| 599 } // namespace content_settings | 599 } // namespace content_settings |
| OLD | NEW |