Commit cc89d6be authored by Alexandr Ilin's avatar Alexandr Ilin Committed by Commit Bot

Revert "predictors: Enable the new preconnect predictor by default"

This reverts commit 5f1039f1.

Reason for revert: multiple tests on Chrome OS became flaky because of disk I/O errors.

Original change's description:
> predictors: Enable the new preconnect predictor by default
> 
> The old predictor is automatically disabled when the new one is enabled.
> 
> Change-Id: Ia5c1a79dbeb0e096720fc3d50da3dc707b3761a6
> Reviewed-on: https://chromium-review.googlesource.com/1042388
> Reviewed-by: Egor Pasko <pasko@chromium.org>
> Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#555766}

TBR=pasko@chromium.org,alexilin@chromium.org
Bug: 839886

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8c286f29cee249990c57486851842e4d9dd900ac
Reviewed-on: https://chromium-review.googlesource.com/1044326Reviewed-by: default avatarAlexandr Ilin <alexilin@chromium.org>
Commit-Queue: Alexandr Ilin <alexilin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556130}
parent 99bb78d3
...@@ -39,7 +39,7 @@ const char kPreconnectMode[] = "preconnect"; ...@@ -39,7 +39,7 @@ const char kPreconnectMode[] = "preconnect";
const char kNoPreconnectMode[] = "no-preconnect"; const char kNoPreconnectMode[] = "no-preconnect";
const base::Feature kSpeculativePreconnectFeature{ const base::Feature kSpeculativePreconnectFeature{
kSpeculativePreconnectFeatureName, base::FEATURE_ENABLED_BY_DEFAULT}; kSpeculativePreconnectFeatureName, base::FEATURE_DISABLED_BY_DEFAULT};
bool MaybeEnableSpeculativePreconnect(LoadingPredictorConfig* config) { bool MaybeEnableSpeculativePreconnect(LoadingPredictorConfig* config) {
if (!base::FeatureList::IsEnabled(kSpeculativePreconnectFeature)) if (!base::FeatureList::IsEnabled(kSpeculativePreconnectFeature))
...@@ -47,9 +47,6 @@ bool MaybeEnableSpeculativePreconnect(LoadingPredictorConfig* config) { ...@@ -47,9 +47,6 @@ bool MaybeEnableSpeculativePreconnect(LoadingPredictorConfig* config) {
std::string mode_value = base::GetFieldTrialParamValueByFeature( std::string mode_value = base::GetFieldTrialParamValueByFeature(
kSpeculativePreconnectFeature, kModeParamName); kSpeculativePreconnectFeature, kModeParamName);
if (mode_value.empty())
mode_value = kPreconnectMode;
if (mode_value == kLearningMode) { if (mode_value == kLearningMode) {
if (config) { if (config) {
config->mode |= LoadingPredictorConfig::LEARNING; config->mode |= LoadingPredictorConfig::LEARNING;
......
...@@ -66,14 +66,12 @@ class LoadingPredictorConfigTest : public testing::Test { ...@@ -66,14 +66,12 @@ class LoadingPredictorConfigTest : public testing::Test {
LoadingPredictorConfigTest::LoadingPredictorConfigTest() LoadingPredictorConfigTest::LoadingPredictorConfigTest()
: profile_(new TestingProfile()) {} : profile_(new TestingProfile()) {}
TEST_F(LoadingPredictorConfigTest, IsEnabledByDefault) { TEST_F(LoadingPredictorConfigTest, IsDisabledByDefault) {
LoadingPredictorConfig config; LoadingPredictorConfig config;
EXPECT_TRUE(MaybeEnableSpeculativePreconnect(&config)); EXPECT_FALSE(MaybeEnableSpeculativePreconnect(&config));
EXPECT_TRUE(config.IsLearningEnabled()); EXPECT_FALSE(config.IsLearningEnabled());
EXPECT_TRUE(config.should_disable_other_preconnects); EXPECT_FALSE(config.IsPreconnectEnabledForSomeOrigin(profile_.get()));
EXPECT_FALSE(IsNetPredictorEnabled());
EXPECT_TRUE(config.IsPreconnectEnabledForSomeOrigin(profile_.get()));
} }
TEST_F(LoadingPredictorConfigTest, EnablePreconnectLearning) { TEST_F(LoadingPredictorConfigTest, EnablePreconnectLearning) {
......
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