Commit 38a75053 authored by Charles Harrison's avatar Charles Harrison Committed by Commit Bot

Reland: [subresource_filter] Enable SubresourceFilter experiment by default

This relands crrev.com/531639. This is fixed by upstreaming CrOS change
https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/886864

Original description:
This also enables the filtering after a phishing interstitial by
default.

Bug: 805966
Change-Id: I691058f6e9c636b6c494b8d03b2e8fa82416d994
Reviewed-on: https://chromium-review.googlesource.com/729144Reviewed-by: default avatarShivani Sharma <shivanisha@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#531639}
Reviewed-on: https://chromium-review.googlesource.com/895707
Cr-Commit-Position: refs/heads/master@{#533345}
parent 3d915b21
...@@ -140,33 +140,8 @@ namespace subresource_filter { ...@@ -140,33 +140,8 @@ namespace subresource_filter {
using subresource_filter::testing::TestRulesetCreator; using subresource_filter::testing::TestRulesetCreator;
using subresource_filter::testing::TestRulesetPair; using subresource_filter::testing::TestRulesetPair;
// SubresourceFilterDisabledBrowserTest ---------------------------------------
class SubresourceFilterDisabledByDefaultBrowserTest
: public InProcessBrowserTest {
public:
SubresourceFilterDisabledByDefaultBrowserTest() {}
protected:
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(
"suppress-enabling-subresource-filter-from-fieldtrial-testing-config");
}
private:
DISALLOW_COPY_AND_ASSIGN(SubresourceFilterDisabledByDefaultBrowserTest);
};
// Tests ----------------------------------------------------------------------- // Tests -----------------------------------------------------------------------
// The RulesetService should not even be instantiated when the feature is
// disabled, which should be the default state unless there is an override
// specified in the field trial configuration.
IN_PROC_BROWSER_TEST_F(SubresourceFilterDisabledByDefaultBrowserTest,
RulesetServiceNotCreated) {
EXPECT_FALSE(g_browser_process->subresource_filter_ruleset_service());
}
IN_PROC_BROWSER_TEST_F(SubresourceFilterListInsertingBrowserTest, IN_PROC_BROWSER_TEST_F(SubresourceFilterListInsertingBrowserTest,
MainFrameActivation_SubresourceFilterList) { MainFrameActivation_SubresourceFilterList) {
content::ConsoleObserverDelegate console_observer(web_contents(), content::ConsoleObserverDelegate console_observer(web_contents(),
......
...@@ -120,7 +120,7 @@ std::vector<Configuration> FillEnabledPresetConfigurations( ...@@ -120,7 +120,7 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
bool enabled_by_default; bool enabled_by_default;
Configuration (*factory_method)(); Configuration (*factory_method)();
} kAvailablePresetConfigurations[] = { } kAvailablePresetConfigurations[] = {
{kPresetLiveRunOnPhishingSites, false, {kPresetLiveRunOnPhishingSites, true,
&Configuration::MakePresetForLiveRunOnPhishingSites}, &Configuration::MakePresetForLiveRunOnPhishingSites},
{kPresetPerformanceTestingDryRunOnAllSites, false, {kPresetPerformanceTestingDryRunOnAllSites, false,
&Configuration::MakePresetForPerformanceTestingDryRunOnAllSites}, &Configuration::MakePresetForPerformanceTestingDryRunOnAllSites},
...@@ -186,7 +186,9 @@ std::vector<Configuration> ParseEnabledConfigurations() { ...@@ -186,7 +186,9 @@ std::vector<Configuration> ParseEnabledConfigurations() {
std::map<std::string, std::string> params; std::map<std::string, std::string> params;
base::GetFieldTrialParamsByFeature(kSafeBrowsingSubresourceFilter, &params); base::GetFieldTrialParamsByFeature(kSafeBrowsingSubresourceFilter, &params);
std::vector<Configuration> configs = FillEnabledPresetConfigurations(&params); std::vector<Configuration> configs;
if (base::FeatureList::IsEnabled(kSafeBrowsingSubresourceFilter))
configs = FillEnabledPresetConfigurations(&params);
Configuration experimental_config = ParseExperimentalConfiguration(&params); Configuration experimental_config = ParseExperimentalConfiguration(&params);
configs.push_back(std::move(experimental_config)); configs.push_back(std::move(experimental_config));
...@@ -234,7 +236,7 @@ base::LazyInstance<scoped_refptr<ConfigurationList>>::Leaky ...@@ -234,7 +236,7 @@ base::LazyInstance<scoped_refptr<ConfigurationList>>::Leaky
// Constant definitions ------------------------------------------------------- // Constant definitions -------------------------------------------------------
const base::Feature kSafeBrowsingSubresourceFilter{ const base::Feature kSafeBrowsingSubresourceFilter{
"SubresourceFilter", base::FEATURE_DISABLED_BY_DEFAULT}; "SubresourceFilter", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kSafeBrowsingSubresourceFilterExperimentalUI{ const base::Feature kSafeBrowsingSubresourceFilterExperimentalUI{
"SubresourceFilterExperimentalUI", base::FEATURE_DISABLED_BY_DEFAULT}; "SubresourceFilterExperimentalUI", 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