OLD | NEW |
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 Loading... |
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 5354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5795 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); | 5796 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); |
5796 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); | 5797 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); |
5797 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); | 5798 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); |
5798 | 5799 |
5799 ExtensionPrefs* prefs = service_->extension_prefs(); | 5800 ExtensionPrefs* prefs = service_->extension_prefs(); |
5800 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & | 5801 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & |
5801 Extension::DISABLE_SIDELOAD_WIPEOUT); | 5802 Extension::DISABLE_SIDELOAD_WIPEOUT); |
5802 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & | 5803 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & |
5803 Extension::DISABLE_SIDELOAD_WIPEOUT); | 5804 Extension::DISABLE_SIDELOAD_WIPEOUT); |
5804 } | 5805 } |
OLD | NEW |