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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 2668863002: [Extensions] Remove FeatureSwitch::easy_off_store_install (Closed)
Patch Set: Add TODO for histograms Created 3 years, 11 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/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index ec5e7e6465eb8f019e218582e3d59ec3c2be28fd..e8f36500e5ed3b8d3f04aec3a98053f39407a883 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -98,7 +98,6 @@
#include "content/public/test/test_navigation_observer.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#include "extensions/browser/extension_system.h"
-#include "extensions/common/feature_switch.h"
#include "net/base/filename_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -123,7 +122,6 @@ using content::DownloadManager;
using content::DownloadUrlParameters;
using content::WebContents;
using extensions::Extension;
-using extensions::FeatureSwitch;
using net::URLRequestMockHTTPJob;
namespace {
@@ -2009,8 +2007,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, AutoOpen) {
// Download an extension. Expect a dangerous download warning.
// Deny the download.
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) {
- FeatureSwitch::ScopedOverride enable_easy_off_store_install(
- FeatureSwitch::easy_off_store_install(), true);
+ std::unique_ptr<base::AutoReset<bool>> allow_offstore_install =
+ download_crx_util::OverrideOffstoreInstallAllowedForTesting(true);
GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
@@ -2034,8 +2032,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstall) {
// Download an extension. Expect a dangerous download warning.
// Allow the download, deny the install.
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallDenysPermissions) {
- FeatureSwitch::ScopedOverride enable_easy_off_store_install(
- FeatureSwitch::easy_off_store_install(), true);
+ std::unique_ptr<base::AutoReset<bool>> allow_offstore_install =
+ download_crx_util::OverrideOffstoreInstallAllowedForTesting(true);
extensions::ScopedTestDialogAutoConfirm auto_confirm_install_prompt(
extensions::ScopedTestDialogAutoConfirm::CANCEL);
@@ -2067,8 +2065,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallDenysPermissions) {
// Download an extension. Expect a dangerous download warning.
// Allow the download, and the install.
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInstallAcceptPermissions) {
- FeatureSwitch::ScopedOverride enable_easy_off_store_install(
- FeatureSwitch::easy_off_store_install(), true);
+ std::unique_ptr<base::AutoReset<bool>> allow_offstore_install =
+ download_crx_util::OverrideOffstoreInstallAllowedForTesting(true);
GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
@@ -2127,8 +2125,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, CrxInvalid) {
// Install a large (100kb) theme.
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxLargeTheme) {
- FeatureSwitch::ScopedOverride enable_easy_off_store_install(
- FeatureSwitch::easy_off_store_install(), true);
+ std::unique_ptr<base::AutoReset<bool>> allow_offstore_install =
+ download_crx_util::OverrideOffstoreInstallAllowedForTesting(true);
GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kLargeThemePath));
@@ -3790,8 +3788,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, AutoOpenClosesShelf) {
}
IN_PROC_BROWSER_TEST_F(DownloadTest, CrxDenyInstallClosesShelf) {
- FeatureSwitch::ScopedOverride enable_easy_off_store_install(
- FeatureSwitch::easy_off_store_install(), true);
+ std::unique_ptr<base::AutoReset<bool>> allow_offstore_install =
+ download_crx_util::OverrideOffstoreInstallAllowedForTesting(true);
GURL extension_url(URLRequestMockHTTPJob::GetMockUrl(kGoodCrxPath));
« no previous file with comments | « no previous file | chrome/browser/download/download_crx_util.h » ('j') | chrome/browser/extensions/crx_installer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698