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

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

Issue 12315053: Fix prefs registration in SyncPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 | Annotate | Revision Log
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/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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 const base::FilePath& pref_file, 441 const base::FilePath& pref_file,
442 const base::FilePath& extensions_install_dir, 442 const base::FilePath& extensions_install_dir,
443 bool autoupdate_enabled) { 443 bool autoupdate_enabled) {
444 TestingProfile::Builder profile_builder; 444 TestingProfile::Builder profile_builder;
445 // Create a PrefService that only contains user defined preference values. 445 // Create a PrefService that only contains user defined preference values.
446 PrefServiceMockBuilder builder; 446 PrefServiceMockBuilder builder;
447 builder.WithUserFilePrefs( 447 builder.WithUserFilePrefs(
448 pref_file, loop_.message_loop_proxy()); 448 pref_file, loop_.message_loop_proxy());
449 scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable); 449 scoped_refptr<PrefRegistrySyncable> registry(new PrefRegistrySyncable);
450 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry)); 450 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable(registry));
451 Profile::RegisterUserPrefs(registry);
452 chrome::RegisterUserPrefs(prefs.get(), registry); 451 chrome::RegisterUserPrefs(prefs.get(), registry);
453 profile_builder.SetPrefService(prefs.Pass()); 452 profile_builder.SetPrefService(prefs.Pass());
454 profile_builder.SetPath(profile_path); 453 profile_builder.SetPath(profile_path);
455 profile_ = profile_builder.Build(); 454 profile_ = profile_builder.Build();
456 455
457 service_ = static_cast<extensions::TestExtensionSystem*>( 456 service_ = static_cast<extensions::TestExtensionSystem*>(
458 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( 457 ExtensionSystem::Get(profile_.get()))->CreateExtensionService(
459 CommandLine::ForCurrentProcess(), 458 CommandLine::ForCurrentProcess(),
460 extensions_install_dir, 459 extensions_install_dir,
461 autoupdate_enabled); 460 autoupdate_enabled);
(...skipping 5397 matching lines...) Expand 10 before | Expand all | Expand 10 after
5859 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5858 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5860 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5859 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5861 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5860 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5862 5861
5863 ExtensionPrefs* prefs = service_->extension_prefs(); 5862 ExtensionPrefs* prefs = service_->extension_prefs();
5864 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5863 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5865 Extension::DISABLE_SIDELOAD_WIPEOUT); 5864 Extension::DISABLE_SIDELOAD_WIPEOUT);
5866 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5865 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5867 Extension::DISABLE_SIDELOAD_WIPEOUT); 5866 Extension::DISABLE_SIDELOAD_WIPEOUT);
5868 } 5867 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698