Index: chrome/browser/extensions/crx_installer_browsertest.cc |
diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc |
index 3009d0d4e3887d974839a40b2aff32c4713c98d9..1151822f393a9eb9ee66945a5ffe284ced79379c 100644 |
--- a/chrome/browser/extensions/crx_installer_browsertest.cc |
+++ b/chrome/browser/extensions/crx_installer_browsertest.cc |
@@ -8,6 +8,7 @@ |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/ui/browser.h" |
+#include "chrome/common/chrome_switches.h" |
#include "chrome/test/base/ui_test_utils.h" |
class SkBitmap; |
@@ -77,9 +78,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, Whitelisting) { |
// crbug.com/105728: Fails because the CRX is invalid. |
IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, |
- FAILS_GalleryInstallGetsExperimental) { |
- ASSERT_FALSE(InstallExtension( |
- test_data_dir_.AppendASCII("experimental.crx"), 0)); |
- ASSERT_TRUE(InstallExtensionFromWebstore( |
- test_data_dir_.AppendASCII("experimental.crx"), 1)); |
+ GalleryInstallGetsExperimental) { |
+ // We must modify the command line temporarily in order to pack an extension |
+ // that requests the experimental permission. |
+ CommandLine* command_line = CommandLine::ForCurrentProcess(); |
+ CommandLine old_command_line = *command_line; |
+ command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
+ FilePath crx_path = PackExtension( |
+ test_data_dir_.AppendASCII("experimental")); |
+ ASSERT_FALSE(crx_path.empty()); |
+ |
+ // Now reset the command line so that we are testing specifically whether |
+ // installing from webstore enables experimental permissions. |
+ *(CommandLine::ForCurrentProcess()) = old_command_line; |
+ |
+ EXPECT_FALSE(InstallExtension(crx_path, 0)); |
+ EXPECT_TRUE(InstallExtensionFromWebstore(crx_path, 1)); |
} |