| 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 17 matching lines...) Expand all Loading... |
| 28 #include "base/version.h" | 28 #include "base/version.h" |
| 29 #include "chrome/browser/browser_process.h" | 29 #include "chrome/browser/browser_process.h" |
| 30 #include "chrome/browser/extensions/component_loader.h" | 30 #include "chrome/browser/extensions/component_loader.h" |
| 31 #include "chrome/browser/extensions/crx_installer.h" | 31 #include "chrome/browser/extensions/crx_installer.h" |
| 32 #include "chrome/browser/extensions/extension_creator.h" | 32 #include "chrome/browser/extensions/extension_creator.h" |
| 33 #include "chrome/browser/extensions/extension_error_reporter.h" | 33 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 34 #include "chrome/browser/extensions/extension_global_error.h" | 34 #include "chrome/browser/extensions/extension_global_error.h" |
| 35 #include "chrome/browser/extensions/extension_service.h" | 35 #include "chrome/browser/extensions/extension_service.h" |
| 36 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 36 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 37 #include "chrome/browser/extensions/extension_sync_data.h" | 37 #include "chrome/browser/extensions/extension_sync_data.h" |
| 38 #include "chrome/browser/extensions/extension_system.h" |
| 39 #include "chrome/browser/extensions/extension_system_factory.h" |
| 38 #include "chrome/browser/extensions/extension_updater.h" | 40 #include "chrome/browser/extensions/extension_updater.h" |
| 39 #include "chrome/browser/extensions/external_extension_provider_impl.h" | 41 #include "chrome/browser/extensions/external_extension_provider_impl.h" |
| 40 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 42 #include "chrome/browser/extensions/external_extension_provider_interface.h" |
| 41 #include "chrome/browser/extensions/external_pref_extension_loader.h" | 43 #include "chrome/browser/extensions/external_pref_extension_loader.h" |
| 42 #include "chrome/browser/extensions/extension_sorting.h" | 44 #include "chrome/browser/extensions/extension_sorting.h" |
| 43 #include "chrome/browser/extensions/installed_loader.h" | 45 #include "chrome/browser/extensions/installed_loader.h" |
| 44 #include "chrome/browser/extensions/pack_extension_job.cc" | 46 #include "chrome/browser/extensions/pack_extension_job.cc" |
| 45 #include "chrome/browser/extensions/pending_extension_info.h" | 47 #include "chrome/browser/extensions/pending_extension_info.h" |
| 46 #include "chrome/browser/extensions/pending_extension_manager.h" | 48 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 49 #include "chrome/browser/extensions/test_extension_system.h" |
| 47 #include "chrome/browser/extensions/unpacked_installer.h" | 50 #include "chrome/browser/extensions/unpacked_installer.h" |
| 48 #include "chrome/browser/plugin_prefs_factory.h" | 51 #include "chrome/browser/plugin_prefs_factory.h" |
| 49 #include "chrome/browser/prefs/browser_prefs.h" | 52 #include "chrome/browser/prefs/browser_prefs.h" |
| 50 #include "chrome/browser/prefs/pref_service_mock_builder.h" | 53 #include "chrome/browser/prefs/pref_service_mock_builder.h" |
| 51 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 54 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 52 #include "chrome/browser/sync/protocol/app_specifics.pb.h" | 55 #include "chrome/browser/sync/protocol/app_specifics.pb.h" |
| 53 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" | 56 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" |
| 54 #include "chrome/browser/sync/protocol/sync.pb.h" | 57 #include "chrome/browser/sync/protocol/sync.pb.h" |
| 55 #include "chrome/browser/themes/theme_service_factory.h" | 58 #include "chrome/browser/themes/theme_service_factory.h" |
| 59 #include "chrome/common/chrome_constants.h" |
| 56 #include "chrome/common/chrome_notification_types.h" | 60 #include "chrome/common/chrome_notification_types.h" |
| 57 #include "chrome/common/chrome_paths.h" | 61 #include "chrome/common/chrome_paths.h" |
| 58 #include "chrome/common/chrome_switches.h" | 62 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/extensions/extension.h" | 63 #include "chrome/common/extensions/extension.h" |
| 60 #include "chrome/common/extensions/extension_constants.h" | 64 #include "chrome/common/extensions/extension_constants.h" |
| 61 #include "chrome/common/extensions/extension_resource.h" | 65 #include "chrome/common/extensions/extension_resource.h" |
| 62 #include "chrome/common/extensions/url_pattern.h" | 66 #include "chrome/common/extensions/url_pattern.h" |
| 63 #include "chrome/common/pref_names.h" | 67 #include "chrome/common/pref_names.h" |
| 64 #include "chrome/common/string_ordinal.h" | 68 #include "chrome/common/string_ordinal.h" |
| 65 #include "chrome/common/url_constants.h" | 69 #include "chrome/common/url_constants.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 369 |
| 366 private: | 370 private: |
| 367 int ids_found_; | 371 int ids_found_; |
| 368 FilePath fake_base_path_; | 372 FilePath fake_base_path_; |
| 369 scoped_ptr<ExternalExtensionProviderImpl> provider_; | 373 scoped_ptr<ExternalExtensionProviderImpl> provider_; |
| 370 scoped_ptr<DictionaryValue> prefs_; | 374 scoped_ptr<DictionaryValue> prefs_; |
| 371 | 375 |
| 372 DISALLOW_COPY_AND_ASSIGN(MockProviderVisitor); | 376 DISALLOW_COPY_AND_ASSIGN(MockProviderVisitor); |
| 373 }; | 377 }; |
| 374 | 378 |
| 375 class ExtensionTestingProfile : public TestingProfile { | |
| 376 public: | |
| 377 ExtensionTestingProfile() : service_(NULL) { | |
| 378 } | |
| 379 | |
| 380 void set_extensions_service(ExtensionService* service) { | |
| 381 service_ = service; | |
| 382 } | |
| 383 virtual ExtensionService* GetExtensionService() { return service_; } | |
| 384 | |
| 385 private: | |
| 386 ExtensionService* service_; | |
| 387 }; | |
| 388 | |
| 389 // Our message loop may be used in tests which require it to be an IO loop. | 379 // Our message loop may be used in tests which require it to be an IO loop. |
| 390 ExtensionServiceTestBase::ExtensionServiceTestBase() | 380 ExtensionServiceTestBase::ExtensionServiceTestBase() |
| 391 : loop_(MessageLoop::TYPE_IO), | 381 : loop_(MessageLoop::TYPE_IO), |
| 392 service_(NULL), | 382 service_(NULL), |
| 393 expected_extensions_count_(0), | 383 expected_extensions_count_(0), |
| 394 ui_thread_(BrowserThread::UI, &loop_), | 384 ui_thread_(BrowserThread::UI, &loop_), |
| 395 db_thread_(BrowserThread::DB, &loop_), | 385 db_thread_(BrowserThread::DB, &loop_), |
| 396 webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &loop_), | 386 webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &loop_), |
| 397 file_thread_(BrowserThread::FILE, &loop_), | 387 file_thread_(BrowserThread::FILE, &loop_), |
| 398 file_user_blocking_thread_(BrowserThread::FILE_USER_BLOCKING, &loop_), | 388 file_user_blocking_thread_(BrowserThread::FILE_USER_BLOCKING, &loop_), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 411 // (they are used in the destruction process). | 401 // (they are used in the destruction process). |
| 412 service_ = NULL; | 402 service_ = NULL; |
| 413 MessageLoop::current()->RunAllPending(); | 403 MessageLoop::current()->RunAllPending(); |
| 414 profile_.reset(NULL); | 404 profile_.reset(NULL); |
| 415 MessageLoop::current()->RunAllPending(); | 405 MessageLoop::current()->RunAllPending(); |
| 416 } | 406 } |
| 417 | 407 |
| 418 void ExtensionServiceTestBase::InitializeExtensionService( | 408 void ExtensionServiceTestBase::InitializeExtensionService( |
| 419 const FilePath& pref_file, const FilePath& extensions_install_dir, | 409 const FilePath& pref_file, const FilePath& extensions_install_dir, |
| 420 bool autoupdate_enabled) { | 410 bool autoupdate_enabled) { |
| 421 ExtensionTestingProfile* profile = new ExtensionTestingProfile(); | 411 TestingProfile* profile = new TestingProfile(); |
| 422 // Create a PrefService that only contains user defined preference values. | 412 // Create a PrefService that only contains user defined preference values. |
| 423 PrefService* prefs = | 413 PrefService* prefs = |
| 424 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create(); | 414 PrefServiceMockBuilder().WithUserFilePrefs(pref_file).Create(); |
| 425 Profile::RegisterUserPrefs(prefs); | 415 Profile::RegisterUserPrefs(prefs); |
| 426 browser::RegisterUserPrefs(prefs); | 416 browser::RegisterUserPrefs(prefs); |
| 427 profile->SetPrefService(prefs); | 417 profile->SetPrefService(prefs); |
| 428 | 418 |
| 429 ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); | 419 ThemeServiceFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); |
| 430 PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); | 420 PluginPrefsFactory::GetInstance()->ForceRegisterPrefsForTest(prefs); |
| 431 | 421 |
| 432 profile_.reset(profile); | 422 profile_.reset(profile); |
| 433 | 423 |
| 434 service_ = profile->CreateExtensionService( | 424 service_ = static_cast<TestExtensionSystem*>( |
| 435 CommandLine::ForCurrentProcess(), | 425 ExtensionSystemFactory::GetForProfile(profile))->CreateExtensionService( |
| 436 extensions_install_dir, | 426 CommandLine::ForCurrentProcess(), |
| 437 autoupdate_enabled); | 427 extensions_install_dir, |
| 428 autoupdate_enabled); |
| 438 service_->set_extensions_enabled(true); | 429 service_->set_extensions_enabled(true); |
| 439 service_->set_show_extensions_prompts(false); | 430 service_->set_show_extensions_prompts(false); |
| 440 profile->set_extensions_service(service_); | |
| 441 | 431 |
| 442 // When we start up, we want to make sure there is no external provider, | 432 // When we start up, we want to make sure there is no external provider, |
| 443 // since the ExtensionService on Windows will use the Registry as a default | 433 // since the ExtensionService on Windows will use the Registry as a default |
| 444 // provider and if there is something already registered there then it will | 434 // provider and if there is something already registered there then it will |
| 445 // interfere with the tests. Those tests that need an external provider | 435 // interfere with the tests. Those tests that need an external provider |
| 446 // will register one specifically. | 436 // will register one specifically. |
| 447 service_->ClearProvidersForTesting(); | 437 service_->ClearProvidersForTesting(); |
| 448 | 438 |
| 449 expected_extensions_count_ = 0; | 439 expected_extensions_count_ = 0; |
| 450 } | 440 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 464 file_util::CopyDirectory(source_install_dir, extensions_install_dir_, true); | 454 file_util::CopyDirectory(source_install_dir, extensions_install_dir_, true); |
| 465 | 455 |
| 466 InitializeExtensionService(temp_prefs, extensions_install_dir_, false); | 456 InitializeExtensionService(temp_prefs, extensions_install_dir_, false); |
| 467 } | 457 } |
| 468 | 458 |
| 469 void ExtensionServiceTestBase::InitializeEmptyExtensionService() { | 459 void ExtensionServiceTestBase::InitializeEmptyExtensionService() { |
| 470 InitializeExtensionServiceHelper(false); | 460 InitializeExtensionServiceHelper(false); |
| 471 } | 461 } |
| 472 | 462 |
| 473 void ExtensionServiceTestBase::InitializeExtensionProcessManager() { | 463 void ExtensionServiceTestBase::InitializeExtensionProcessManager() { |
| 474 profile_->CreateExtensionProcessManager(); | 464 static_cast<TestExtensionSystem*>( |
| 465 ExtensionSystemFactory::GetForProfile(profile_.get()))-> |
| 466 CreateExtensionProcessManager(); |
| 475 } | 467 } |
| 476 | 468 |
| 477 void ExtensionServiceTestBase::InitializeExtensionServiceWithUpdater() { | 469 void ExtensionServiceTestBase::InitializeExtensionServiceWithUpdater() { |
| 478 InitializeExtensionServiceHelper(true); | 470 InitializeExtensionServiceHelper(true); |
| 479 service_->updater()->Start(); | 471 service_->updater()->Start(); |
| 480 } | 472 } |
| 481 | 473 |
| 482 void ExtensionServiceTestBase::InitializeExtensionServiceHelper( | 474 void ExtensionServiceTestBase::InitializeExtensionServiceHelper( |
| 483 bool autoupdate_enabled) { | 475 bool autoupdate_enabled) { |
| 484 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 476 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 485 FilePath path_ = temp_dir_.path(); | 477 FilePath path_ = temp_dir_.path(); |
| 486 path_ = path_.Append(FILE_PATH_LITERAL("TestingExtensionsPath")); | 478 path_ = path_.Append(FILE_PATH_LITERAL("TestingExtensionsPath")); |
| 487 file_util::Delete(path_, true); | 479 file_util::Delete(path_, true); |
| 488 file_util::CreateDirectory(path_); | 480 file_util::CreateDirectory(path_); |
| 489 FilePath prefs_filename = path_ | 481 FilePath prefs_filename = path_ |
| 490 .Append(FILE_PATH_LITERAL("TestPreferences")); | 482 .Append(FILE_PATH_LITERAL("TestPreferences")); |
| 491 extensions_install_dir_ = path_.Append(FILE_PATH_LITERAL("Extensions")); | 483 extensions_install_dir_ = path_.Append(FILE_PATH_LITERAL("Extensions")); |
| 492 file_util::Delete(extensions_install_dir_, true); | 484 file_util::Delete(extensions_install_dir_, true); |
| 493 file_util::CreateDirectory(extensions_install_dir_); | 485 file_util::CreateDirectory(extensions_install_dir_); |
| 494 | 486 |
| 495 InitializeExtensionService(prefs_filename, extensions_install_dir_, | 487 InitializeExtensionService(prefs_filename, extensions_install_dir_, |
| 496 autoupdate_enabled); | 488 autoupdate_enabled); |
| 497 } | 489 } |
| 498 | 490 |
| 499 void ExtensionServiceTestBase::InitializeRequestContext() { | 491 void ExtensionServiceTestBase::InitializeRequestContext() { |
| 500 ASSERT_TRUE(profile_.get()); | 492 ASSERT_TRUE(profile_.get()); |
| 501 ExtensionTestingProfile* profile = | 493 TestingProfile* profile = |
| 502 static_cast<ExtensionTestingProfile*>(profile_.get()); | 494 static_cast<TestingProfile*>(profile_.get()); |
| 503 profile->CreateRequestContext(); | 495 profile->CreateRequestContext(); |
| 504 } | 496 } |
| 505 | 497 |
| 506 // static | 498 // static |
| 507 void ExtensionServiceTestBase::SetUpTestCase() { | 499 void ExtensionServiceTestBase::SetUpTestCase() { |
| 508 ExtensionErrorReporter::Init(false); // no noisy errors | 500 ExtensionErrorReporter::Init(false); // no noisy errors |
| 509 } | 501 } |
| 510 | 502 |
| 511 void ExtensionServiceTestBase::SetUp() { | 503 void ExtensionServiceTestBase::SetUp() { |
| 512 ExtensionErrorReporter::GetInstance()->ClearErrors(); | 504 ExtensionErrorReporter::GetInstance()->ClearErrors(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 int expected_installed_extension_count = | 731 int expected_installed_extension_count = |
| 740 (expected_state >= INSTALLED) ? 1 : 0; | 732 (expected_state >= INSTALLED) ? 1 : 0; |
| 741 int expected_enabled_extension_count = | 733 int expected_enabled_extension_count = |
| 742 (expected_state >= ENABLED) ? 1 : 0; | 734 (expected_state >= ENABLED) ? 1 : 0; |
| 743 EXPECT_EQ(expected_installed_extension_count, | 735 EXPECT_EQ(expected_installed_extension_count, |
| 744 installed_extension_count); | 736 installed_extension_count); |
| 745 EXPECT_EQ(expected_enabled_extension_count, | 737 EXPECT_EQ(expected_enabled_extension_count, |
| 746 enabled_extension_count); | 738 enabled_extension_count); |
| 747 } | 739 } |
| 748 | 740 |
| 749 // Update() should delete the temporary input file. | 741 // Update() should the temporary input file. |
| 750 EXPECT_FALSE(file_util::PathExists(path)); | 742 EXPECT_FALSE(file_util::PathExists(path)); |
| 751 } | 743 } |
| 752 | 744 |
| 753 void TerminateExtension(const std::string& id) { | 745 void TerminateExtension(const std::string& id) { |
| 754 const Extension* extension = service_->GetInstalledExtension(id); | 746 const Extension* extension = service_->GetInstalledExtension(id); |
| 755 if (!extension) { | 747 if (!extension) { |
| 756 ADD_FAILURE(); | 748 ADD_FAILURE(); |
| 757 return; | 749 return; |
| 758 } | 750 } |
| 759 service_->TrackTerminatedExtensionForTest(extension); | 751 service_->TrackTerminatedExtensionForTest(extension); |
| (...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3853 content::TestBrowserThread ui_thread(BrowserThread::UI, &loop); | 3845 content::TestBrowserThread ui_thread(BrowserThread::UI, &loop); |
| 3854 content::TestBrowserThread file_thread(BrowserThread::FILE, &loop); | 3846 content::TestBrowserThread file_thread(BrowserThread::FILE, &loop); |
| 3855 scoped_ptr<CommandLine> command_line; | 3847 scoped_ptr<CommandLine> command_line; |
| 3856 FilePath install_dir = profile->GetPath() | 3848 FilePath install_dir = profile->GetPath() |
| 3857 .AppendASCII(ExtensionService::kInstallDirectoryName); | 3849 .AppendASCII(ExtensionService::kInstallDirectoryName); |
| 3858 webkit::npapi::MockPluginList plugin_list(NULL, 0); | 3850 webkit::npapi::MockPluginList plugin_list(NULL, 0); |
| 3859 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); | 3851 PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); |
| 3860 | 3852 |
| 3861 // By default, we are enabled. | 3853 // By default, we are enabled. |
| 3862 command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 3854 command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| 3863 // Owned by |profile|. | 3855 ExtensionService* service = static_cast<TestExtensionSystem*>( |
| 3864 ExtensionService* service = | 3856 ExtensionSystemFactory::GetForProfile(profile.get()))-> |
| 3865 profile->CreateExtensionService(command_line.get(), | 3857 CreateExtensionService( |
| 3866 install_dir, | 3858 command_line.get(), |
| 3867 false); | 3859 install_dir, |
| 3860 false); |
| 3868 EXPECT_TRUE(service->extensions_enabled()); | 3861 EXPECT_TRUE(service->extensions_enabled()); |
| 3869 service->Init(); | 3862 service->Init(); |
| 3870 loop.RunAllPending(); | 3863 loop.RunAllPending(); |
| 3871 EXPECT_TRUE(recorder.ready()); | 3864 EXPECT_TRUE(recorder.ready()); |
| 3872 | 3865 |
| 3873 // If either the command line or pref is set, we are disabled. | 3866 // If either the command line or pref is set, we are disabled. |
| 3874 recorder.set_ready(false); | 3867 recorder.set_ready(false); |
| 3875 profile.reset(new TestingProfile()); | 3868 profile.reset(new TestingProfile()); |
| 3876 command_line->AppendSwitch(switches::kDisableExtensions); | 3869 command_line->AppendSwitch(switches::kDisableExtensions); |
| 3877 service = profile->CreateExtensionService(command_line.get(), | 3870 service = static_cast<TestExtensionSystem*>( |
| 3878 install_dir, | 3871 ExtensionSystemFactory::GetForProfile(profile.get()))-> |
| 3879 false); | 3872 CreateExtensionService( |
| 3873 command_line.get(), |
| 3874 install_dir, |
| 3875 false); |
| 3880 EXPECT_FALSE(service->extensions_enabled()); | 3876 EXPECT_FALSE(service->extensions_enabled()); |
| 3881 service->Init(); | 3877 service->Init(); |
| 3882 loop.RunAllPending(); | 3878 loop.RunAllPending(); |
| 3883 EXPECT_TRUE(recorder.ready()); | 3879 EXPECT_TRUE(recorder.ready()); |
| 3884 | 3880 |
| 3885 recorder.set_ready(false); | 3881 recorder.set_ready(false); |
| 3886 profile.reset(new TestingProfile()); | 3882 profile.reset(new TestingProfile()); |
| 3887 profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); | 3883 profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); |
| 3888 service = profile->CreateExtensionService(command_line.get(), | 3884 service = static_cast<TestExtensionSystem*>( |
| 3889 install_dir, | 3885 ExtensionSystemFactory::GetForProfile(profile.get()))-> |
| 3890 false); | 3886 CreateExtensionService( |
| 3887 command_line.get(), |
| 3888 install_dir, |
| 3889 false); |
| 3891 EXPECT_FALSE(service->extensions_enabled()); | 3890 EXPECT_FALSE(service->extensions_enabled()); |
| 3892 service->Init(); | 3891 service->Init(); |
| 3893 loop.RunAllPending(); | 3892 loop.RunAllPending(); |
| 3894 EXPECT_TRUE(recorder.ready()); | 3893 EXPECT_TRUE(recorder.ready()); |
| 3895 | 3894 |
| 3896 recorder.set_ready(false); | 3895 recorder.set_ready(false); |
| 3897 profile.reset(new TestingProfile()); | 3896 profile.reset(new TestingProfile()); |
| 3898 profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); | 3897 profile->GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); |
| 3899 command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 3898 command_line.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| 3900 service = profile->CreateExtensionService(command_line.get(), | 3899 service = static_cast<TestExtensionSystem*>( |
| 3901 install_dir, | 3900 ExtensionSystemFactory::GetForProfile(profile.get()))-> |
| 3902 false); | 3901 CreateExtensionService( |
| 3902 command_line.get(), |
| 3903 install_dir, |
| 3904 false); |
| 3903 EXPECT_FALSE(service->extensions_enabled()); | 3905 EXPECT_FALSE(service->extensions_enabled()); |
| 3904 service->Init(); | 3906 service->Init(); |
| 3905 loop.RunAllPending(); | 3907 loop.RunAllPending(); |
| 3906 EXPECT_TRUE(recorder.ready()); | 3908 EXPECT_TRUE(recorder.ready()); |
| 3907 | 3909 |
| 3908 // Explicitly delete all the resources used in this test. | 3910 // Explicitly delete all the resources used in this test. |
| 3909 profile.reset(); | 3911 profile.reset(); |
| 3910 service = NULL; | 3912 service = NULL; |
| 3911 } | 3913 } |
| 3912 | 3914 |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4857 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", | 4859 provider->UpdateOrAddExtension(hosted_app, "1.0.0.0", |
| 4858 data_dir_.AppendASCII("hosted_app.crx")); | 4860 data_dir_.AppendASCII("hosted_app.crx")); |
| 4859 | 4861 |
| 4860 service_->CheckForExternalUpdates(); | 4862 service_->CheckForExternalUpdates(); |
| 4861 loop_.RunAllPending(); | 4863 loop_.RunAllPending(); |
| 4862 | 4864 |
| 4863 ASSERT_TRUE(service_->PopulateExtensionGlobalError( | 4865 ASSERT_TRUE(service_->PopulateExtensionGlobalError( |
| 4864 extension_global_error.get())); | 4866 extension_global_error.get())); |
| 4865 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); | 4867 ASSERT_EQ(1u, extension_global_error->get_external_extension_ids()->size()); |
| 4866 } | 4868 } |
| OLD | NEW |