Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4859)

Unified Diff: chrome/browser/extensions/extension_webstore_private_apitest.cc

Issue 10010038: Do not show the install prompt for themes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_webstore_private_apitest.cc
diff --git a/chrome/browser/extensions/extension_webstore_private_apitest.cc b/chrome/browser/extensions/extension_webstore_private_apitest.cc
index 75b5104eb8dec8b66f8e20e0f4344d27f33dfae3..6115d10bf5d513ae6a4066b893e029b129623092 100644
--- a/chrome/browser/extensions/extension_webstore_private_apitest.cc
+++ b/chrome/browser/extensions/extension_webstore_private_apitest.cc
@@ -135,6 +135,21 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
}
};
+// The same as ExtensionWebstorePrivateApiTest except it uses the default
+// install prompt behavior.
+class ExtensionNoConfirmWebstorePrivateApiTest
+ : public ExtensionWebstorePrivateApiTest {
+ public:
+ void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ // We set this switch here to supercede the value set in
+ // ExtensionWebstorePrivateApiTest (you can't easily remove switches).
Yoyo Zhou 2012/04/20 15:38:14 Could you make the inheritance go the other way so
jstritar 2012/04/20 16:18:27 Done.
+ command_line->AppendSwitchASCII(
+ switches::kAppsGalleryInstallAutoConfirmForTests, "default");
+
+ ExtensionWebstorePrivateApiTest::SetUpCommandLine(command_line);
+ }
+};
+
class ExtensionWebstorePrivateBundleTest
: public ExtensionWebstorePrivateApiTest {
public:
@@ -329,6 +344,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, BeginInstall) {
EXPECT_EQ(browser()->profile(), approval->profile);
}
+// Tests that themes are installed without an install prompt.
+IN_PROC_BROWSER_TEST_F(ExtensionNoConfirmWebstorePrivateApiTest, InstallTheme) {
+ WebstoreInstallListener listener;
+ WebstorePrivateApi::SetWebstoreInstallerDelegateForTesting(&listener);
+ ASSERT_TRUE(RunInstallTest("theme.html", "../../theme.crx"));
+ listener.Wait();
+ ASSERT_TRUE(listener.received_success());
+ ASSERT_EQ("iamefpfkojoapidjnbafmgkgncegbkad", listener.id());
+}
+
// Tests using silentlyInstall to install extensions.
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateBundleTest, SilentlyInstall) {
WebstorePrivateApi::SetTrustTestIDsForTesting(true);

Powered by Google App Engine
This is Rietveld 408576698