Commit d534b729 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

rm DataCompressionProxyHoldback Field Trial code

This code is complicating changing the feature, so time to remove it!

Bug: 1048736
Change-Id: Ia410d07f5ae16db540159a2d4b46aaec1731e15e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037814Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738364}
parent cdc726dc
......@@ -333,8 +333,9 @@ TEST_F(DataReductionProxySettingsAndroidTest,
TEST_F(DataReductionProxySettingsAndroidTest,
MaybeRewriteWebliteUrlWithHoldbackEnabled) {
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataCompressionProxyHoldback", "Enabled"));
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
data_reduction_proxy::features::kDataReductionProxyHoldback);
Init();
drp_test_context()->EnableDataReductionProxyWithSecureProxyCheckSuccess();
......@@ -343,7 +344,7 @@ TEST_F(DataReductionProxySettingsAndroidTest,
MaybeRewriteWebliteUrlAsUTF8(
"http://googleweblight.com/i?u=http://example.com/"));
// DataCompressionProxyHoldback should not affect https webpages.
// DataReductionProxyHoldback should not affect https webpages.
EXPECT_EQ("https://example.com/",
MaybeRewriteWebliteUrlAsUTF8(
"https://googleweblight.com/i?u=https://example.com/"));
......
......@@ -213,8 +213,9 @@ class DataReductionProxyConfigTest : public testing::Test {
};
TEST_F(DataReductionProxyConfigTest, TestReloadConfigHoldback) {
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataCompressionProxyHoldback", "Enabled"));
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
features::kDataReductionProxyHoldback);
const net::ProxyServer kHttpsProxy = net::ProxyServer::FromURI(
"https://secure_origin.net:443", net::ProxyServer::SCHEME_HTTP);
......
......@@ -12,6 +12,7 @@
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
......@@ -22,6 +23,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
#include "components/data_reduction_proxy/core/browser/network_properties_manager.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params_test_utils.h"
......@@ -130,8 +132,10 @@ TEST_F(DataReductionProxyServiceTest, TestResetBadProxyListOnDisableDataSaver) {
}
TEST_F(DataReductionProxyServiceTest, HoldbackConfiguresProxies) {
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataCompressionProxyHoldback", "Enabled"));
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(
features::kDataReductionProxyHoldback);
std::unique_ptr<DataReductionProxyTestContext> drp_test_context =
DataReductionProxyTestContext::Builder()
.SkipSettingsInitialization()
......
......@@ -100,16 +100,8 @@ bool IsIncludedInFREPromoFieldTrial() {
}
bool IsIncludedInHoldbackFieldTrial() {
// For now, DRP can be disabled using either the field trial or the feature.
// New server configs should use the feature capability.
// TODO(tbansal): Remove the field trial code.
return base::FeatureList::IsEnabled(
data_reduction_proxy::features::kDataReductionProxyHoldback) ||
IsIncludedInFieldTrial("DataCompressionProxyHoldback");
}
std::string HoldbackFieldTrialGroup() {
return base::FieldTrialList::FindFullName("DataCompressionProxyHoldback");
data_reduction_proxy::features::kDataReductionProxyHoldback);
}
bool ForceEnableClientConfigServiceForAllDataSaverUsers() {
......
......@@ -294,29 +294,6 @@ TEST_F(DataReductionProxyParamsTest, QuicEnableNonCoreProxies) {
}
}
TEST_F(DataReductionProxyParamsTest, HoldbackEnabledFieldTrial) {
const struct {
std::string trial_group_name;
bool expected_enabled;
} tests[] = {
{"Enabled", true},
{"Enabled_Control", true},
{"Disabled", false},
{"enabled", false},
};
for (const auto& test : tests) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.Init();
ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
"DataCompressionProxyHoldback", test.trial_group_name));
EXPECT_EQ(test.trial_group_name, params::HoldbackFieldTrialGroup());
EXPECT_EQ(test.expected_enabled, params::IsIncludedInHoldbackFieldTrial())
<< test.trial_group_name;
}
}
TEST_F(DataReductionProxyParamsTest, PromoFieldTrial) {
const struct {
std::string trial_group_name;
......
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