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

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

Issue 8741004: Fix broken ExtensionCrxInstallerTest.GalleryInstallGetsExperimental test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/experimental.crx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « no previous file | chrome/test/data/extensions/experimental.crx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698