Don't check for extensions being idle in ExtensionServiceTest.
In unit tests there is no ExtensionProcessManager, and more specifically
for these tests we don't want to wait for extensions to become idle
anyway.
BUG=160664
Review URL: https://chromiumcodereview.appspot.com/11360230
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167726 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 044a530e..bafe23c 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -356,6 +356,7 @@
install_directory_(install_directory),
extensions_enabled_(extensions_enabled),
show_extensions_prompts_(true),
+ install_updates_when_idle_(true),
ready_(false),
toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
menu_manager_(profile),
@@ -2334,8 +2335,8 @@
GetExtensionByIdInternal(id, include_mask);
// If this is an upgrade and the extension/app has a background page that can
// be idle but isn't, we delay the upgrade until the background page is idle.
- if (wait_for_idle && old && !IsExtensionIdle(id) &&
- !old->has_persistent_background_page()) {
+ if (install_updates_when_idle_ && wait_for_idle && old &&
+ !IsExtensionIdle(id) && !old->has_persistent_background_page()) {
extension_prefs_->SetIdleInstallInfo(
extension,
initial_enable ? Extension::ENABLED : Extension::DISABLED);
@@ -2938,12 +2939,7 @@
bool ExtensionService::IsExtensionIdle(const std::string& extension_id) const {
ExtensionProcessManager* process_manager = system_->process_manager();
-
- // If there is no ExtensionProcessManager then assume the process is idle.
- // This is commonly the case in unit-tests.
- if (process_manager == NULL)
- return true;
-
+ DCHECK(process_manager);
extensions::ExtensionHost* host =
process_manager->GetBackgroundHostForExtension(extension_id);
return !host;