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