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

Unified Diff: chrome/browser/predictors/resource_prefetch_common_unittest.cc

Issue 2804963002: predictors: Put manifests for ResourcePrefetchPredictor behind a flag. (Closed)
Patch Set: Created 3 years, 8 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/predictors/resource_prefetch_common_unittest.cc
diff --git a/chrome/browser/predictors/resource_prefetch_common_unittest.cc b/chrome/browser/predictors/resource_prefetch_common_unittest.cc
index f5f3fa6518e161b7f3306a7f8a7e6349f5100a08..33ebc5939e1c864035fae65599f94227a01e73aa 100644
--- a/chrome/browser/predictors/resource_prefetch_common_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_common_unittest.cc
@@ -72,6 +72,7 @@ class ResourcePrefetchCommonTest : public testing::Test {
EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
EXPECT_FALSE(config.IsSmallDBEnabledForTest());
EXPECT_FALSE(config.is_url_learning_enabled);
+ EXPECT_FALSE(config.is_manifests_enabled);
EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U);
}
@@ -148,6 +149,18 @@ TEST_F(ResourcePrefetchCommonTest, EnableUrlLearning) {
EXPECT_TRUE(config.is_url_learning_enabled);
}
+TEST_F(ResourcePrefetchCommonTest, EnableManifests) {
+ variations::testing::VariationParamsManager params_manager(
+ "dummy-trial",
+ {{kModeParamName, kLearningMode}, {kEnableManifestsParamName, "true"}},
+ {kSpeculativeResourcePrefetchingFeatureName});
+
+ ResourcePrefetchPredictorConfig config;
+ EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
+ TestIsPrefetchLearning(config);
+ EXPECT_TRUE(config.is_manifests_enabled);
+}
+
// Verifies whether prefetching is disabled according to the network type. But
// learning should not be disabled by network.
TEST_F(ResourcePrefetchCommonTest, RespectsNetworkSettings) {
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.cc ('k') | chrome/browser/predictors/resource_prefetch_predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698