Fix force policy installation of the removed pref-installed extension

This fixes the issue with the extension not being force-installed
through the admin policy when it was previously installed by the
external preference and then manually removed by the user.

BUG=651197
TEST=Unit test

Review-Url: https://codereview.chromium.org/2409743002
Cr-Commit-Position: refs/heads/master@{#424245}
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index f7544ab..e146ead 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -1234,6 +1234,17 @@
       Extension::NO_FLAGS,
       false));
 
+  // Installation of the same extension through the policy should be successful.
+  ASSERT_TRUE(service()->pending_extension_manager()->AddFromExternalUpdateUrl(
+      good_crx,
+      std::string(),
+      GURL("http:://fake.update/url"),
+      Manifest::EXTERNAL_POLICY_DOWNLOAD,
+      Extension::NO_FLAGS,
+      false));
+  EXPECT_TRUE(service()->pending_extension_manager()->IsIdPending(good_crx));
+  EXPECT_TRUE(service()->pending_extension_manager()->Remove(good_crx));
+
   ASSERT_FALSE(service()->pending_extension_manager()->IsIdPending(good_crx));
 }