| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 } | 403 } |
| 404 | 404 |
| 405 void ExtensionServiceTestBase::InitializeExtensionService( | 405 void ExtensionServiceTestBase::InitializeExtensionService( |
| 406 const FilePath& pref_file, const FilePath& extensions_install_dir, | 406 const FilePath& pref_file, const FilePath& extensions_install_dir, |
| 407 bool autoupdate_enabled) { | 407 bool autoupdate_enabled) { |
| 408 TestingProfile* profile = new TestingProfile(); | 408 TestingProfile* profile = new TestingProfile(); |
| 409 // Create a PrefService that only contains user defined preference values. | 409 // Create a PrefService that only contains user defined preference values. |
| 410 PrefService* prefs = | 410 PrefService* prefs = |
| 411 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create(); | 411 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create(); |
| 412 Profile::RegisterUserPrefs(prefs); | 412 Profile::RegisterUserPrefs(prefs); |
| 413 browser::RegisterUserPrefs(prefs); | 413 chrome::RegisterUserPrefs(prefs); |
| 414 profile->SetPrefService(prefs); | 414 profile->SetPrefService(prefs); |
| 415 | 415 |
| 416 ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); | 416 ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); |
| 417 PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); | 417 PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); |
| 418 | 418 |
| 419 profile_.reset(profile); | 419 profile_.reset(profile); |
| 420 | 420 |
| 421 service_ = static_cast<TestExtensionSystem*>( | 421 service_ = static_cast<TestExtensionSystem*>( |
| 422 ExtensionSystem::Get(profile))->CreateExtensionService( | 422 ExtensionSystem::Get(profile))->CreateExtensionService( |
| 423 CommandLine::ForCurrentProcess(), | 423 CommandLine::ForCurrentProcess(), |
| (...skipping 4802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5226 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", | 5226 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", |
| 5227 data_dir_.AppendASCII("hosted_app.crx")); | 5227 data_dir_.AppendASCII("hosted_app.crx")); |
| 5228 | 5228 |
| 5229 service_->CheckForExternalUpdates(); | 5229 service_->CheckForExternalUpdates(); |
| 5230 loop_.RunAllPending(); | 5230 loop_.RunAllPending(); |
| 5231 | 5231 |
| 5232 ASSERT_TRUE(service_->PopulateExtensionGlobalError( | 5232 ASSERT_TRUE(service_->PopulateExtensionGlobalError( |
| 5233 extension_global_error.get())); | 5233 extension_global_error.get())); |
| 5234 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); | 5234 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); |
| 5235 } | 5235 } |
| OLD | NEW |