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

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indentation Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/extensions/extension_service_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 476 }
477 477
478 void ExtensionServiceTestBase::InitializeExtensionService( 478 void ExtensionServiceTestBase::InitializeExtensionService(
479 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) { 479 const ExtensionServiceTestBase::ExtensionServiceInitParams& params) {
480 TestingProfile::Builder profile_builder; 480 TestingProfile::Builder profile_builder;
481 // Create a PrefService that only contains user defined preference values. 481 // Create a PrefService that only contains user defined preference values.
482 PrefServiceMockBuilder builder; 482 PrefServiceMockBuilder builder;
483 // If pref_file is empty, TestingProfile automatically creates 483 // If pref_file is empty, TestingProfile automatically creates
484 // TestingPrefServiceSyncable instance. 484 // TestingPrefServiceSyncable instance.
485 if (!params.pref_file.empty()) { 485 if (!params.pref_file.empty()) {
486 builder.WithUserFilePrefs(params.pref_file, 486 builder.SetUserPrefsFile(params.pref_file,
487 base::MessageLoopProxy::current().get()); 487 base::MessageLoopProxy::current().get());
488 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( 488 scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
489 new user_prefs::PrefRegistrySyncable); 489 new user_prefs::PrefRegistrySyncable);
490 scoped_ptr<PrefServiceSyncable> prefs( 490 scoped_ptr<PrefServiceSyncable> prefs(
491 builder.CreateSyncable(registry.get())); 491 builder.CreateSyncable(registry.get()));
492 chrome::RegisterUserProfilePrefs(registry.get()); 492 chrome::RegisterUserProfilePrefs(registry.get());
493 profile_builder.SetPrefService(prefs.Pass()); 493 profile_builder.SetPrefService(prefs.Pass());
494 } 494 }
495 495
496 if (params.profile_is_managed) 496 if (params.profile_is_managed)
497 profile_builder.SetManagedUserId("asdf"); 497 profile_builder.SetManagedUserId("asdf");
(...skipping 6183 matching lines...) Expand 10 before | Expand all | Expand 10 after
6681 service_->ReconcileKnownDisabled(); 6681 service_->ReconcileKnownDisabled();
6682 expected_extensions.insert(good2); 6682 expected_extensions.insert(good2);
6683 expected_disabled_extensions.erase(good2); 6683 expected_disabled_extensions.erase(good2);
6684 6684
6685 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); 6685 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs());
6686 EXPECT_EQ(expected_disabled_extensions, 6686 EXPECT_EQ(expected_disabled_extensions,
6687 service_->disabled_extensions()->GetIDs()); 6687 service_->disabled_extensions()->GetIDs());
6688 } 6688 }
6689 6689
6690 #endif // #if !(defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS)) 6690 #endif // #if !(defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698