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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 MessageLoop::current()->RunUntilIdle(); 418 MessageLoop::current()->RunUntilIdle();
419 } 419 }
420 420
421 void ExtensionServiceTestBase::InitializeExtensionService( 421 void ExtensionServiceTestBase::InitializeExtensionService(
422 const FilePath& profile_path, 422 const FilePath& profile_path,
423 const FilePath& pref_file, 423 const FilePath& pref_file,
424 const FilePath& extensions_install_dir, 424 const FilePath& extensions_install_dir,
425 bool autoupdate_enabled) { 425 bool autoupdate_enabled) {
426 TestingProfile::Builder profile_builder; 426 TestingProfile::Builder profile_builder;
427 // Create a PrefService that only contains user defined preference values. 427 // Create a PrefService that only contains user defined preference values.
428 scoped_ptr<PrefService> prefs( 428 PrefServiceMockBuilder builder;
429 PrefServiceMockBuilder().WithUserFilePrefs( 429 builder.WithUserFilePrefs(
430 pref_file, loop_.message_loop_proxy()).Create()); 430 pref_file, loop_.message_loop_proxy());
431 scoped_ptr<PrefServiceSyncable> prefs(builder.CreateSyncable());
431 Profile::RegisterUserPrefs(prefs.get()); 432 Profile::RegisterUserPrefs(prefs.get());
432 chrome::RegisterUserPrefs(prefs.get()); 433 chrome::RegisterUserPrefs(prefs.get());
433 profile_builder.SetPrefService(prefs.Pass()); 434 profile_builder.SetPrefService(prefs.Pass());
434 profile_builder.SetPath(profile_path); 435 profile_builder.SetPath(profile_path);
435 profile_ = profile_builder.Build(); 436 profile_ = profile_builder.Build();
436 437
437 service_ = static_cast<extensions::TestExtensionSystem*>( 438 service_ = static_cast<extensions::TestExtensionSystem*>(
438 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( 439 ExtensionSystem::Get(profile_.get()))->CreateExtensionService(
439 CommandLine::ForCurrentProcess(), 440 CommandLine::ForCurrentProcess(),
440 extensions_install_dir, 441 extensions_install_dir,
(...skipping 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after
5785 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); 5786 EXPECT_FALSE(extensions::HasExternalInstallError(service_));
5786 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); 5787 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx));
5787 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); 5788 EXPECT_TRUE(service_->IsExtensionEnabled(page_action));
5788 5789
5789 ExtensionPrefs* prefs = service_->extension_prefs(); 5790 ExtensionPrefs* prefs = service_->extension_prefs();
5790 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & 5791 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) &
5791 Extension::DISABLE_SIDELOAD_WIPEOUT); 5792 Extension::DISABLE_SIDELOAD_WIPEOUT);
5792 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & 5793 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) &
5793 Extension::DISABLE_SIDELOAD_WIPEOUT); 5794 Extension::DISABLE_SIDELOAD_WIPEOUT);
5794 } 5795 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698