Commit 863692c6 authored by Roger Tawa's avatar Roger Tawa Committed by Commit Bot

Make sure all Webprotect feature flags are disabled by default.

Bug: 1015065
Change-Id: I570988d8350f48aaaeca132ce3c0ec2ff80ff476
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864879
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706907}
parent eb8da3be
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
namespace extensions { namespace extensions {
const base::Feature SafeBrowsingPrivateEventRouter::kRealtimeReportingFeature{ const base::Feature SafeBrowsingPrivateEventRouter::kRealtimeReportingFeature{
"SafeBrowsingRealtimeReporting", base::FEATURE_ENABLED_BY_DEFAULT}; "SafeBrowsingRealtimeReporting", base::FEATURE_DISABLED_BY_DEFAULT};
// Key names used with when building the dictionary to pass to the real-time // Key names used with when building the dictionary to pass to the real-time
// reporting API. // reporting API.
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
namespace safe_browsing { namespace safe_browsing {
const base::Feature kDeepScanningOfUploads{"DeepScanningOfUploads", const base::Feature kDeepScanningOfUploads{"DeepScanningOfUploads",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// TODO(rogerta): keeping this disabled by default until UX is finalized. // TODO(rogerta): keeping this disabled by default until UX is finalized.
const base::Feature kDeepScanningOfUploadsUI{"DeepScanningOfUploadsUI", const base::Feature kDeepScanningOfUploadsUI{"DeepScanningOfUploadsUI",
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool/thread_pool_instance.h" #include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -67,6 +68,7 @@ ...@@ -67,6 +68,7 @@
#include "components/safe_browsing/db/database_manager.h" #include "components/safe_browsing/db/database_manager.h"
#include "components/safe_browsing/db/test_database_manager.h" #include "components/safe_browsing/db/test_database_manager.h"
#include "components/safe_browsing/db/v4_protocol_manager_util.h" #include "components/safe_browsing/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/features.h"
#include "components/safe_browsing/proto/csd.pb.h" #include "components/safe_browsing/proto/csd.pb.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/download_item_utils.h" #include "content/public/browser/download_item_utils.h"
...@@ -226,6 +228,11 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness { ...@@ -226,6 +228,11 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness {
void SetUp() override { void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp(); ChromeRenderViewHostTestHarness::SetUp();
// Enable the feature early to prevent race condition trying to access
// the enabled features set. This happens for example when the history
// service is started below.
EnableFeature(kDeepScanningOfDownloads);
in_process_utility_thread_helper_ = in_process_utility_thread_helper_ =
std::make_unique<content::InProcessUtilityThreadHelper>(); std::make_unique<content::InProcessUtilityThreadHelper>();
...@@ -313,6 +320,11 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness { ...@@ -313,6 +320,11 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness {
ChromeRenderViewHostTestHarness::TearDown(); ChromeRenderViewHostTestHarness::TearDown();
} }
void EnableFeature(const base::Feature& feature) {
scoped_feature_list_.Reset();
scoped_feature_list_.InitAndEnableFeature(feature);
}
void SetWhitelistedDownloadSampleRate(double target_rate) { void SetWhitelistedDownloadSampleRate(double target_rate) {
download_service_->whitelist_sample_rate_ = target_rate; download_service_->whitelist_sample_rate_ = target_rate;
} }
...@@ -617,6 +629,8 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness { ...@@ -617,6 +629,8 @@ class DownloadProtectionServiceTest : public ChromeRenderViewHostTestHarness {
void CheckClientDownloadReportCorruptArchive(ArchiveType type); void CheckClientDownloadReportCorruptArchive(ArchiveType type);
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_;
// This will effectively mask the global Singleton while this is in scope. // This will effectively mask the global Singleton while this is in scope.
FileTypePoliciesTestOverlay policies_; FileTypePoliciesTestOverlay policies_;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/nullable_string16.h" #include "base/strings/nullable_string16.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_dialog_delegate.h" #include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_dialog_delegate.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/fake_deep_scanning_dialog_delegate.h" #include "chrome/browser/safe_browsing/cloud_content_scanning/fake_deep_scanning_dialog_delegate.h"
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.h" #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_handle_drop.h"
...@@ -39,12 +40,19 @@ class ChromeWebContentsViewDelegateHandleOnPerformDrop : public testing::Test { ...@@ -39,12 +40,19 @@ class ChromeWebContentsViewDelegateHandleOnPerformDrop : public testing::Test {
return web_contents_.get(); return web_contents_.get();
} }
void EnableFeature(const base::Feature& feature) {
scoped_feature_list_.Reset();
scoped_feature_list_.InitAndEnableFeature(feature);
}
void EnableDeepScanning(bool enable, bool scan_succeeds) { void EnableDeepScanning(bool enable, bool scan_succeeds) {
SetScanPolicies(enable ? safe_browsing::CHECK_UPLOADS SetScanPolicies(enable ? safe_browsing::CHECK_UPLOADS
: safe_browsing::CHECK_NONE); : safe_browsing::CHECK_NONE);
if (!enable) if (!enable)
return; return;
EnableFeature(safe_browsing::kDeepScanningOfUploads);
run_loop_.reset(new base::RunLoop()); run_loop_.reset(new base::RunLoop());
using FakeDelegate = safe_browsing::FakeDeepScanningDialogDelegate; using FakeDelegate = safe_browsing::FakeDeepScanningDialogDelegate;
...@@ -103,6 +111,7 @@ class ChromeWebContentsViewDelegateHandleOnPerformDrop : public testing::Test { ...@@ -103,6 +111,7 @@ class ChromeWebContentsViewDelegateHandleOnPerformDrop : public testing::Test {
} }
content::BrowserTaskEnvironment task_environment_; content::BrowserTaskEnvironment task_environment_;
base::test::ScopedFeatureList scoped_feature_list_;
TestingProfileManager profile_manager_{TestingBrowserProcess::GetGlobal()}; TestingProfileManager profile_manager_{TestingBrowserProcess::GetGlobal()};
TestingProfile* profile_; TestingProfile* profile_;
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
......
...@@ -39,7 +39,7 @@ const base::Feature kCommittedSBInterstitials{ ...@@ -39,7 +39,7 @@ const base::Feature kCommittedSBInterstitials{
"SafeBrowsingCommittedInterstitials", base::FEATURE_DISABLED_BY_DEFAULT}; "SafeBrowsingCommittedInterstitials", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDeepScanningOfDownloads{ const base::Feature kDeepScanningOfDownloads{
"SafeBrowsingDeepScanningOfDownloads", base::FEATURE_ENABLED_BY_DEFAULT}; "SafeBrowsingDeepScanningOfDownloads", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kForceUseAPDownloadProtection{ const base::Feature kForceUseAPDownloadProtection{
"ForceUseAPDownloadProtection", base::FEATURE_DISABLED_BY_DEFAULT}; "ForceUseAPDownloadProtection", base::FEATURE_DISABLED_BY_DEFAULT};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment