| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 | 416 |
| 417 void ExtensionServiceTestBase::InitializeExtensionService( | 417 void ExtensionServiceTestBase::InitializeExtensionService( |
| 418 const FilePath& profile_path, | 418 const FilePath& profile_path, |
| 419 const FilePath& pref_file, | 419 const FilePath& pref_file, |
| 420 const FilePath& extensions_install_dir, | 420 const FilePath& extensions_install_dir, |
| 421 bool autoupdate_enabled) { | 421 bool autoupdate_enabled) { |
| 422 TestingProfile::Builder profile_builder; | 422 TestingProfile::Builder profile_builder; |
| 423 // Create a PrefService that only contains user defined preference values. | 423 // Create a PrefService that only contains user defined preference values. |
| 424 scoped_ptr<PrefService> prefs( | 424 scoped_ptr<PrefService> prefs( |
| 425 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create()); | 425 PrefServiceMockBuilder().WithUserFilePrefs( |
| 426 pref_file, loop_.message_loop_proxy()).Create()); |
| 426 Profile::RegisterUserPrefs(prefs.get()); | 427 Profile::RegisterUserPrefs(prefs.get()); |
| 427 chrome::RegisterUserPrefs(prefs.get()); | 428 chrome::RegisterUserPrefs(prefs.get()); |
| 428 profile_builder.SetPrefService(prefs.Pass()); | 429 profile_builder.SetPrefService(prefs.Pass()); |
| 429 profile_builder.SetPath(profile_path); | 430 profile_builder.SetPath(profile_path); |
| 430 profile_ = profile_builder.Build(); | 431 profile_ = profile_builder.Build(); |
| 431 | 432 |
| 432 service_ = static_cast<extensions::TestExtensionSystem*>( | 433 service_ = static_cast<extensions::TestExtensionSystem*>( |
| 433 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( | 434 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( |
| 434 CommandLine::ForCurrentProcess(), | 435 CommandLine::ForCurrentProcess(), |
| 435 extensions_install_dir, | 436 extensions_install_dir, |
| (...skipping 5301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5737 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); | 5738 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); |
| 5738 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); | 5739 EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); |
| 5739 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); | 5740 EXPECT_TRUE(service_->IsExtensionEnabled(page_action)); |
| 5740 | 5741 |
| 5741 ExtensionPrefs* prefs = service_->extension_prefs(); | 5742 ExtensionPrefs* prefs = service_->extension_prefs(); |
| 5742 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & | 5743 EXPECT_NE(0, prefs->GetDisableReasons(good_crx) & |
| 5743 Extension::DISABLE_SIDELOAD_WIPEOUT); | 5744 Extension::DISABLE_SIDELOAD_WIPEOUT); |
| 5744 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & | 5745 EXPECT_EQ(0, prefs->GetDisableReasons(page_action) & |
| 5745 Extension::DISABLE_SIDELOAD_WIPEOUT); | 5746 Extension::DISABLE_SIDELOAD_WIPEOUT); |
| 5746 } | 5747 } |
| OLD | NEW |