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

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: Comment change. 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
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); 451 Profile::RegisterUserPrefs(registry);
452 chrome::RegisterUserPrefs(prefs.get(), registry); 452 chrome::RegisterUserPrefs(registry);
453 profile_builder.SetPrefService(prefs.Pass()); 453 profile_builder.SetPrefService(prefs.Pass());
454 profile_builder.SetPath(profile_path); 454 profile_builder.SetPath(profile_path);
455 profile_ = profile_builder.Build(); 455 profile_ = profile_builder.Build();
456 456
457 service_ = static_cast<extensions::TestExtensionSystem*>( 457 service_ = static_cast<extensions::TestExtensionSystem*>(
458 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( 458 ExtensionSystem::Get(profile_.get()))->CreateExtensionService(
459 CommandLine::ForCurrentProcess(), 459 CommandLine::ForCurrentProcess(),
460 extensions_install_dir, 460 extensions_install_dir,
461 autoupdate_enabled); 461 autoupdate_enabled);
462 service_->SetFileTaskRunnerForTesting(loop_.message_loop_proxy()); 462 service_->SetFileTaskRunnerForTesting(loop_.message_loop_proxy());
(...skipping 5396 matching lines...) Expand 10 before | Expand all | Expand 10 after
5859 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5859 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5860 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5860 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5861 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5861 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5862 5862
5863 ExtensionPrefs* prefs = service_->extension_prefs(); 5863 ExtensionPrefs* prefs = service_->extension_prefs();
5864 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5864 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5865 Extension::DISABLE_SIDELOAD_WIPEOUT); 5865 Extension::DISABLE_SIDELOAD_WIPEOUT);
5866 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5866 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5867 Extension::DISABLE_SIDELOAD_WIPEOUT); 5867 Extension::DISABLE_SIDELOAD_WIPEOUT);
5868 } 5868 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698