Silently install blacklisted extensions from auto-install locations (sync,
policy, etc) into a blacklisted state, rather than not-silently not-installing
them. This new behaviour is correct from a sync perspective, and the old
behaviour is quite annoying.

BUG=257677
[email protected],[email protected]
[email protected],[email protected],[email protected]

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214806 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc
index 9a764d9..9cdfcafab 100644
--- a/chrome/browser/extensions/crx_installer_browsertest.cc
+++ b/chrome/browser/extensions/crx_installer_browsertest.cc
@@ -107,7 +107,6 @@
                              approval.get()       /* keep ownership */));
     installer->set_allow_silent_install(true);
     installer->set_is_gallery_install(true);
-    installer->set_bypass_blacklist_for_test(true);
     installer->InstallCrx(PackExtension(ext_path));
     content::RunMessageLoop();
 
@@ -379,4 +378,18 @@
   ASSERT_EQ("3.0", extension->version()->GetString());
 }
 
+IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, Blacklist) {
+  extensions::Blacklist* blacklist =
+      ExtensionSystem::Get(profile())->blacklist();
+
+  // Fake the blacklisting of the extension we're about to install by
+  // pretending that we get a blacklist update which includes it.
+  const std::string kId = "gllekhaobjnhgeagipipnkpmmmpchacm";
+  blacklist->SetFromUpdater(std::vector<std::string>(1, kId), "some-version");
+
+  base::FilePath crx_path = test_data_dir_.AppendASCII("theme_hidpi_crx")
+                                          .AppendASCII("theme_hidpi.crx");
+  EXPECT_FALSE(InstallExtension(crx_path, 0));
+}
+
 }  // namespace extensions