| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 } | 413 } |
| 414 | 414 |
| 415 void ExtensionServiceTestBase::InitializeExtensionService( | 415 void ExtensionServiceTestBase::InitializeExtensionService( |
| 416 const FilePath& profile_path, | 416 const FilePath& profile_path, |
| 417 const FilePath& pref_file, | 417 const FilePath& pref_file, |
| 418 const FilePath& extensions_install_dir, | 418 const FilePath& extensions_install_dir, |
| 419 bool autoupdate_enabled) { | 419 bool autoupdate_enabled) { |
| 420 TestingProfile::Builder profile_builder; | 420 TestingProfile::Builder profile_builder; |
| 421 // Create a PrefService that only contains user defined preference values. | 421 // Create a PrefService that only contains user defined preference values. |
| 422 scoped_ptr<PrefService> prefs( | 422 scoped_ptr<PrefService> prefs( |
| 423 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create()); | 423 PrefServiceMockBuilder().WithUserFilePrefs( |
| 424 pref_file, loop_.message_loop_proxy()).Create()); |
| 424 Profile::RegisterUserPrefs(prefs.get()); | 425 Profile::RegisterUserPrefs(prefs.get()); |
| 425 chrome::RegisterUserPrefs(prefs.get()); | 426 chrome::RegisterUserPrefs(prefs.get()); |
| 426 profile_builder.SetPrefService(prefs.Pass()); | 427 profile_builder.SetPrefService(prefs.Pass()); |
| 427 profile_builder.SetPath(profile_path); | 428 profile_builder.SetPath(profile_path); |
| 428 profile_ = profile_builder.Build(); | 429 profile_ = profile_builder.Build(); |
| 429 | 430 |
| 430 service_ = static_cast<extensions::TestExtensionSystem*>( | 431 service_ = static_cast<extensions::TestExtensionSystem*>( |
| 431 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( | 432 ExtensionSystem::Get(profile_.get()))->CreateExtensionService( |
| 432 CommandLine::ForCurrentProcess(), | 433 CommandLine::ForCurrentProcess(), |
| 433 extensions_install_dir, | 434 extensions_install_dir, |
| (...skipping 5230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5664 EXPECT_FALSE(service_->IsExtensionEnabled(theme_crx)); | 5665 EXPECT_FALSE(service_->IsExtensionEnabled(theme_crx)); |
| 5665 | 5666 |
| 5666 service_->EnableExtension(page_action); | 5667 service_->EnableExtension(page_action); |
| 5667 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); | 5668 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
| 5668 service_->EnableExtension(theme_crx); | 5669 service_->EnableExtension(theme_crx); |
| 5669 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); | 5670 EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
| 5670 service_->EnableExtension(good_crx); | 5671 service_->EnableExtension(good_crx); |
| 5671 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); | 5672 EXPECT_FALSE(extensions::HasExternalInstallError(service_)); |
| 5672 } | 5673 } |
| 5673 #endif // !defined(OS_CHROMEOS) | 5674 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |