Prevent duplicate installations of an extension when the new installation has the same version and location as the pending installation.

This triggers when an ExternalLoader updates its list while an extension is still installing.

BUG=161920


Review URL: https://chromiumcodereview.appspot.com/11440034

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171752 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index def4e8a..ca13331 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -5304,12 +5304,13 @@
   WaitForCrxInstall(kInvalidPathToCrx, INSTALL_FAILED);
 
   // Simulate an external source adding as EXTERNAL_PREF again.
-  EXPECT_TRUE(
+  // This is rejected because the version and the location are the same as
+  // the previous installation, which is still pending.
+  EXPECT_FALSE(
       service_->OnExternalExtensionFileFound(
           kGoodId, &older_version, kInvalidPathToCrx,
           Extension::EXTERNAL_PREF, kCreationFlags, kDontMarkAcknowledged));
   EXPECT_TRUE(pending->IsIdPending(kGoodId));
-  WaitForCrxInstall(kInvalidPathToCrx, INSTALL_FAILED);
 
   // Try INTERNAL again.  Should fail.
   EXPECT_FALSE(