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

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

Issue 2811673002: Reland: Stop passing raw pointers to base::Value API in c/b/chromeos and c/b/extensions (Closed)
Patch Set: Workaround with std::move Created 3 years, 8 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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698