Index: chrome/browser/extensions/extension_service_unittest.cc |
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc |
index f74f0cfb5db3aa0368c07fac70d1654fd92f4a48..65ee389cfa1e1a902ad1f8d72c5809891e07bdea 100644 |
--- a/chrome/browser/extensions/extension_service_unittest.cc |
+++ b/chrome/browser/extensions/extension_service_unittest.cc |
@@ -411,9 +411,9 @@ ExtensionServiceTestBase::~ExtensionServiceTestBase() { |
// can be destroyed while BrowserThreads and MessageLoop are still around |
// (they are used in the destruction process). |
service_ = NULL; |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
profile_.reset(NULL); |
- MessageLoop::current()->RunAllPending(); |
+ MessageLoop::current()->RunUntilIdle(); |
} |
void ExtensionServiceTestBase::InitializeExtensionService( |
@@ -604,7 +604,7 @@ class ExtensionServiceTest |
} |
// Create a CrxInstaller and start installation. To allow the install |
- // to happen, use loop_.RunAllPending();. Most tests will not use this |
+ // to happen, use loop_.RunUntilIdle();. Most tests will not use this |
// method directly. Instead, use InstallCrx(), which waits for |
// the crx to be installed and does extra error checking. |
void StartCRXInstall(const FilePath& crx_path) { |
@@ -692,7 +692,7 @@ class ExtensionServiceTest |
// Returns an Extension pointer if the install succeeded, NULL otherwise. |
const Extension* WaitForCrxInstall(const FilePath& path, |
InstallState install_state) { |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
std::vector<string16> errors = GetErrors(); |
const Extension* extension = NULL; |
if (install_state != INSTALL_FAILED) { |
@@ -766,7 +766,7 @@ class ExtensionServiceTest |
service_->disabled_extensions()->size(); |
service_->UpdateExtension(id, path, GURL(), NULL); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
std::vector<string16> errors = GetErrors(); |
int error_count = errors.size(); |
@@ -848,7 +848,7 @@ class ExtensionServiceTest |
// The extension should not be in the service anymore. |
EXPECT_FALSE(service_->GetInstalledExtension(id)); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// The directory should be gone. |
EXPECT_FALSE(file_util::PathExists(extension_path)); |
@@ -1396,7 +1396,7 @@ TEST_F(ExtensionServiceTest, InstallingExternalExtensionWithFlags) { |
Extension::EXTERNAL_PREF, |
Extension::FROM_BOOKMARK, |
false /* mark_acknowledged */); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
const Extension* extension = service_->GetExtensionById(good_crx, false); |
ASSERT_TRUE(extension); |
@@ -1424,7 +1424,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { |
service_->OnExternalExtensionFileFound(good_crx, &version, |
path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_TRUE(service_->GetExtensionById(good_crx, false)); |
// Uninstall it and check that its killbit gets set. |
@@ -1436,7 +1436,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { |
service_->OnExternalExtensionFileFound(good_crx, &version, |
path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_TRUE(NULL == service_->GetExtensionById(good_crx, false)); |
ValidateIntegerPref(good_crx, "location", |
Extension::EXTERNAL_EXTENSION_UNINSTALLED); |
@@ -1447,7 +1447,7 @@ TEST_F(ExtensionServiceTest, UninstallingExternalExtensions) { |
service_->OnExternalExtensionFileFound(good_crx, &version, |
path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_TRUE(NULL == service_->GetExtensionById(good_crx, false)); |
ValidateIntegerPref(good_crx, "location", |
Extension::EXTERNAL_EXTENSION_UNINSTALLED); |
@@ -1507,14 +1507,14 @@ TEST_F(ExtensionServiceTest, FailOnWrongId) { |
wrong_id, &version, path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_FALSE(service_->GetExtensionById(good_crx, false)); |
// Try again with the right ID. Expect success. |
service_->OnExternalExtensionFileFound( |
correct_id, &version, path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_TRUE(service_->GetExtensionById(good_crx, false)); |
} |
@@ -1531,7 +1531,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) { |
good_crx, &wrong_version, path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_FALSE(service_->GetExtensionById(good_crx, false)); |
// Try again with the right version. Expect success. |
@@ -1540,7 +1540,7 @@ TEST_F(ExtensionServiceTest, FailOnWrongVersion) { |
service_->OnExternalExtensionFileFound( |
good_crx, &correct_version, path, Extension::EXTERNAL_PREF, |
Extension::NO_FLAGS, false); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_TRUE(service_->GetExtensionById(good_crx, false)); |
} |
@@ -1560,7 +1560,7 @@ TEST_F(ExtensionServiceTest, InstallUserScript) { |
path, |
GURL("http://www.aaronboodman.com/scripts/user_script_basic.user.js")); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
std::vector<string16> errors = GetErrors(); |
EXPECT_TRUE(installed_) << "Nothing was installed."; |
ASSERT_EQ(1u, loaded_.size()) << "Nothing was loaded."; |
@@ -1585,7 +1585,7 @@ TEST_F(ExtensionServiceTest, InstallExtensionDuringShutdown) { |
scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(service_, NULL)); |
installer->set_allow_silent_install(true); |
installer->InstallCrx(path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_FALSE(installed_) << "Extension installed during shutdown."; |
ASSERT_EQ(0u, loaded_.size()) << "Extension loaded during shutdown."; |
@@ -2061,7 +2061,7 @@ TEST_F(ExtensionServiceTest, LoadLocalizedTheme) { |
.AppendASCII("theme_i18n"); |
extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
EXPECT_EQ(1u, service_->extensions()->size()); |
@@ -2095,7 +2095,7 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionCanChangeID) { |
file_util::CopyFile(manifest_no_key, manifest_path); |
extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
EXPECT_EQ(1u, service_->extensions()->size()); |
@@ -2138,7 +2138,7 @@ TEST_F(ExtensionServiceTest, UnpackedExtensionMayContainSymlinkedFiles) { |
// Load extension. |
InitializeEmptyExtensionService(); |
extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(GetErrors().empty()); |
ASSERT_EQ(1u, loaded_.size()); |
@@ -2485,7 +2485,7 @@ TEST_F(ExtensionServiceTest, UpdateNotInstalledExtension) { |
FilePath path = data_dir_.AppendASCII("good.crx"); |
UpdateExtension(good_crx, path, UPDATED); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, service_->extensions()->size()); |
ASSERT_FALSE(installed_); |
@@ -2589,7 +2589,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsCanDowngrade) { |
ASSERT_TRUE(serializer.Serialize(manifest)); |
extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
@@ -2603,7 +2603,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsCanDowngrade) { |
ASSERT_TRUE(serializer.Serialize(manifest)); |
extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
@@ -2639,7 +2639,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsWithPlugins) { |
// The extension that has a plugin should not install. |
extensions::UnpackedInstaller::Create(service_)->Load( |
extension_with_plugin_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
EXPECT_EQ(0u, loaded_.size()); |
EXPECT_EQ(0u, service_->extensions()->size()); |
@@ -2648,7 +2648,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsWithPlugins) { |
// But the extension with no plugin should since there's no prompt. |
extensions::UnpackedInstaller::Create(service_)->Load( |
extension_no_plugin_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
EXPECT_EQ(1u, loaded_.size()); |
EXPECT_EQ(1u, service_->extensions()->size()); |
@@ -2662,7 +2662,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsWithPlugins) { |
extensions::UnpackedInstaller::Create(service_)->Load( |
extension_with_plugin_path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
EXPECT_EQ(2u, loaded_.size()); |
EXPECT_EQ(2u, service_->extensions()->size()); |
@@ -2685,7 +2685,7 @@ TEST_F(ExtensionServiceTest, LoadExtensionsWithPlugins) { |
"cancel"); |
service_->ReloadExtension(good1); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1u, loaded_.size()); |
EXPECT_EQ(2u, service_->extensions()->size()); |
EXPECT_EQ(0u, service_->disabled_extensions()->size()); |
@@ -2927,7 +2927,7 @@ TEST_F(ExtensionServiceTest, SetUnsetBlacklistInPrefs) { |
"v1"); |
// Make sure pref is updated |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// blacklist is set for good0,1,2 |
ValidateBooleanPref(good0, "blacklist", true); |
@@ -2964,7 +2964,7 @@ TEST_F(ExtensionServiceTest, UnloadBlacklistedExtension) { |
"v1"); |
// Make sure pref is updated |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Now, the good_crx is blacklisted. |
ValidateBooleanPref(good_crx, "blacklist", true); |
@@ -2976,7 +2976,7 @@ TEST_F(ExtensionServiceTest, UnloadBlacklistedExtension) { |
"v2"); |
// Make sure pref is updated |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// blacklist value should not be set for good_crx |
EXPECT_FALSE(IsPrefExist(good_crx, "blacklist")); |
} |
@@ -2990,7 +2990,7 @@ TEST_F(ExtensionServiceTest, BlacklistedExtensionWillNotInstall) { |
"v1"); |
// Make sure pref is updated |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Now, the good_crx is blacklisted. |
ValidateBooleanPref(good_crx, "blacklist", true); |
@@ -3133,7 +3133,7 @@ TEST_F(ExtensionServiceTest, WillNotLoadBlacklistedExtensionsFromDirectory) { |
"v1"); |
// Make sure pref is updated |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ValidateBooleanPref(good1, "blacklist", true); |
@@ -3200,7 +3200,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyRemovedIfRunning) { |
} |
// Extension should not be running now. |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, service_->extensions()->size()); |
} |
@@ -3244,7 +3244,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { |
ListValue* blacklist = update.Get(); |
blacklist->Append(Value::CreateStringValue(good0)); |
} |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, service_->extensions()->size()); |
EXPECT_TRUE(service_->GetExtensionById(good0, false)); |
} |
@@ -3272,7 +3272,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { |
// Reloading extensions should find our externally registered extension |
// and install it. |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Extension should be installed despite blacklist. |
ASSERT_EQ(1u, service_->extensions()->size()); |
@@ -3285,7 +3285,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { |
ListValue* blacklist = update.Get(); |
blacklist->Append(Value::CreateStringValue(good0)); |
} |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, service_->extensions()->size()); |
EXPECT_TRUE(service_->GetExtensionById(good_crx, false)); |
} |
@@ -3450,7 +3450,7 @@ TEST_F(ExtensionServiceTest, ExternalExtensionAutoAcknowledgement) { |
// Providers are set up. Let them run. |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(2u, service_->extensions()->size()); |
EXPECT_TRUE(service_->GetExtensionById(good_crx, false)); |
@@ -3490,7 +3490,7 @@ TEST_F(ExtensionServiceTest, DefaultAppsInstall) { |
ASSERT_EQ(0u, service_->extensions()->size()); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, service_->extensions()->size()); |
EXPECT_TRUE(service_->GetExtensionById(good_crx, false)); |
@@ -3731,7 +3731,7 @@ TEST_F(ExtensionServiceTest, UnpackedRequirements) { |
FilePath path = data_dir_.AppendASCII("requirements") |
.AppendASCII("v2_bad_requirements"); |
extensions::UnpackedInstaller::Create(service_)->Load(path); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1u, GetErrors().size()); |
EXPECT_EQ(0u, service_->extensions()->size()); |
} |
@@ -3782,14 +3782,14 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { |
ext_url, "dummy=value", options, |
base::Bind(&ExtensionCookieCallback::SetCookieCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(callback.result_); |
cookie_monster->GetAllCookiesForURLAsync( |
ext_url, |
base::Bind(&ExtensionCookieCallback::GetAllCookiesCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1U, callback.list_.size()); |
// Open a database. |
@@ -3827,14 +3827,14 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { |
// Uninstall the extension. |
service_->UninstallExtension(good_crx, false, NULL); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Check that the cookie is gone. |
cookie_monster->GetAllCookiesForURLAsync( |
ext_url, |
base::Bind(&ExtensionCookieCallback::GetAllCookiesCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0U, callback.list_.size()); |
// The database should have vanished as well. |
@@ -3895,14 +3895,14 @@ TEST_F(ExtensionServiceTest, ClearAppData) { |
origin1, "dummy=value", options, |
base::Bind(&ExtensionCookieCallback::SetCookieCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(callback.result_); |
cookie_monster->GetAllCookiesForURLAsync( |
origin1, |
base::Bind(&ExtensionCookieCallback::GetAllCookiesCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1U, callback.list_.size()); |
// Open a database. |
@@ -3950,7 +3950,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { |
origin1, |
base::Bind(&ExtensionCookieCallback::GetAllCookiesCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1U, callback.list_.size()); |
// Now uninstall the other. Storage should be cleared for the apps. |
@@ -3964,7 +3964,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { |
origin1, |
base::Bind(&ExtensionCookieCallback::GetAllCookiesCallback, |
base::Unretained(&callback))); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0U, callback.list_.size()); |
// The database should have vanished as well. |
@@ -3989,7 +3989,7 @@ TEST_F(ExtensionServiceTest, LoadExtension) { |
.AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
.AppendASCII("1.0.0.0"); |
extensions::UnpackedInstaller::Create(service_)->Load(ext1); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
EXPECT_EQ(Extension::LOAD, loaded_[0]->location()); |
@@ -4003,7 +4003,7 @@ TEST_F(ExtensionServiceTest, LoadExtension) { |
.AppendASCII("cccccccccccccccccccccccccccccccc") |
.AppendASCII("1"); |
extensions::UnpackedInstaller::Create(service_)->Load(no_manifest); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(1u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
EXPECT_EQ(1u, service_->extensions()->size()); |
@@ -4012,7 +4012,7 @@ TEST_F(ExtensionServiceTest, LoadExtension) { |
std::string id = loaded_[0]->id(); |
EXPECT_FALSE(unloaded_id_.length()); |
service_->UninstallExtension(id, false, NULL); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(id, unloaded_id_); |
ASSERT_EQ(0u, loaded_.size()); |
EXPECT_EQ(0u, service_->extensions()->size()); |
@@ -4025,7 +4025,7 @@ TEST_F(ExtensionServiceTest, GenerateID) { |
FilePath no_id_ext = data_dir_.AppendASCII("no_id"); |
extensions::UnpackedInstaller::Create(service_)->Load(no_id_ext); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
ASSERT_TRUE(Extension::IdIsValid(loaded_[0]->id())); |
@@ -4037,7 +4037,7 @@ TEST_F(ExtensionServiceTest, GenerateID) { |
// If we reload the same path, we should get the same extension ID. |
extensions::UnpackedInstaller::Create(service_)->Load(no_id_ext); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, loaded_.size()); |
ASSERT_EQ(previous_id, loaded_[0]->id()); |
} |
@@ -4059,7 +4059,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// Reloading extensions should find our externally registered extension |
// and install it. |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
@@ -4073,7 +4073,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// loaded again. |
loaded_.clear(); |
service_->ReloadExtensions(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
ValidatePrefKeyCount(1); |
@@ -4086,7 +4086,7 @@ void ExtensionServiceTest::TestExternalProvider( |
loaded_.clear(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
ASSERT_EQ("1.0.0.1", loaded_[0]->version()->GetString()); |
@@ -4098,7 +4098,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// preference should prevent us from reinstalling. |
std::string id = loaded_[0]->id(); |
service_->UninstallExtension(id, false, NULL); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
FilePath install_path = extensions_install_dir_.AppendASCII(id); |
if (Extension::IsRequired(location)) { |
@@ -4109,7 +4109,7 @@ void ExtensionServiceTest::TestExternalProvider( |
ASSERT_FALSE(file_util::PathExists(install_path)); |
loaded_.clear(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, loaded_.size()); |
ValidatePrefKeyCount(1); |
ValidateIntegerPref(good_crx, "state", |
@@ -4121,7 +4121,7 @@ void ExtensionServiceTest::TestExternalProvider( |
loaded_.clear(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, loaded_.size()); |
} |
ValidatePrefKeyCount(1); |
@@ -4137,7 +4137,7 @@ void ExtensionServiceTest::TestExternalProvider( |
loaded_.clear(); |
service_->OnExternalProviderReady(provider); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, loaded_.size()); |
ValidatePrefKeyCount(0); |
@@ -4148,7 +4148,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// from the external provider. |
provider->UpdateOrAddExtension(good_crx, "1.0.0.1", source_path); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(1u, loaded_.size()); |
ASSERT_EQ(0u, GetErrors().size()); |
@@ -4156,7 +4156,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// User uninstalls. |
loaded_.clear(); |
service_->UninstallExtension(id, false, NULL); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, loaded_.size()); |
// Then remove the extension from the extension provider. |
@@ -4165,7 +4165,7 @@ void ExtensionServiceTest::TestExternalProvider( |
// Should still be at 0. |
loaded_.clear(); |
extensions::InstalledLoader(service_).LoadAllExtensions(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, loaded_.size()); |
ValidatePrefKeyCount(1); |
@@ -4260,7 +4260,7 @@ TEST_F(ExtensionServiceTest, ExternalUninstall) { |
// Verify that it's not the disabled extensions flag causing it not to load. |
set_extensions_enabled(true); |
service_->ReloadExtensions(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(0u, loaded_.size()); |
@@ -4283,7 +4283,7 @@ TEST_F(ExtensionServiceTest, MultipleExternalUpdateCheck) { |
provider->set_visit_count(0); |
service_->CheckForExternalUpdates(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Two calls should cause two checks for external extensions. |
EXPECT_EQ(2, provider->visit_count()); |
@@ -4299,7 +4299,7 @@ TEST_F(ExtensionServiceTest, MultipleExternalUpdateCheck) { |
provider->set_visit_count(0); |
service_->CheckForExternalUpdates(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_EQ(2, provider->visit_count()); |
ASSERT_EQ(0u, GetErrors().size()); |
ASSERT_EQ(1u, loaded_.size()); |
@@ -4313,7 +4313,7 @@ TEST_F(ExtensionServiceTest, MultipleExternalUpdateCheck) { |
provider->set_visit_count(0); |
service_->CheckForExternalUpdates(); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
// Two calls should cause two checks for external extensions. |
// Because the external source no longer includes good_crx, |
@@ -4576,7 +4576,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { |
false); |
EXPECT_TRUE(service->extensions_enabled()); |
service->Init(); |
- loop.RunAllPending(); |
+ loop.RunUntilIdle(); |
EXPECT_TRUE(recorder.ready()); |
// If either the command line or pref is set, we are disabled. |
@@ -4591,7 +4591,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { |
false); |
EXPECT_FALSE(service->extensions_enabled()); |
service->Init(); |
- loop.RunAllPending(); |
+ loop.RunUntilIdle(); |
EXPECT_TRUE(recorder.ready()); |
recorder.set_ready(false); |
@@ -4605,7 +4605,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { |
false); |
EXPECT_FALSE(service->extensions_enabled()); |
service->Init(); |
- loop.RunAllPending(); |
+ loop.RunUntilIdle(); |
EXPECT_TRUE(recorder.ready()); |
recorder.set_ready(false); |
@@ -4620,14 +4620,14 @@ TEST(ExtensionServiceTestSimple, Enabledness) { |
false); |
EXPECT_FALSE(service->extensions_enabled()); |
service->Init(); |
- loop.RunAllPending(); |
+ loop.RunUntilIdle(); |
EXPECT_TRUE(recorder.ready()); |
// Explicitly delete all the resources used in this test. |
profile.reset(); |
service = NULL; |
// Execute any pending deletion tasks. |
- loop.RunAllPending(); |
+ loop.RunUntilIdle(); |
// Ensure that even if the PluginService is re-used for a later test, it |
// won't still hold a reference to the stack position of our MockPluginList. |
@@ -4657,7 +4657,7 @@ TEST_F(ExtensionServiceTest, StorageQuota) { |
extensions::UnpackedInstaller::Create(service_)->Load(limited_quota_ext); |
extensions::UnpackedInstaller::Create(service_)->Load(unlimited_quota_ext); |
extensions::UnpackedInstaller::Create(service_)->Load(unlimited_quota_ext2); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
ASSERT_EQ(3u, loaded_.size()); |
EXPECT_TRUE(profile_.get()); |
@@ -5728,7 +5728,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) { |
InstallCRX(path, INSTALL_NEW); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_FALSE(extensions::HasExternalInstallError(service_)); |
// A hosted app, installed externally. |
@@ -5737,7 +5737,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) { |
data_dir_.AppendASCII("hosted_app.crx")); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
service_->EnableExtension(hosted_app); |
EXPECT_FALSE(extensions::HasExternalInstallError(service_)); |
@@ -5748,7 +5748,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallGlobalError) { |
data_dir_.AppendASCII("page_action.crx")); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
} |
@@ -5767,7 +5767,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallInitiallyDisabled) { |
data_dir_.AppendASCII("page_action.crx")); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
EXPECT_FALSE(service_->IsExtensionEnabled(page_action)); |
@@ -5799,7 +5799,7 @@ TEST_F(ExtensionServiceTest, ExternalInstallMultiple) { |
data_dir_.AppendASCII("theme.crx")); |
service_->CheckForExternalUpdates(); |
- loop_.RunAllPending(); |
+ loop_.RunUntilIdle(); |
EXPECT_TRUE(extensions::HasExternalInstallError(service_)); |
EXPECT_FALSE(service_->IsExtensionEnabled(page_action)); |
EXPECT_FALSE(service_->IsExtensionEnabled(good_crx)); |