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

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

Issue 2847183002: predictors: Introduce GlowplugPredictor. (Closed)
Patch Set: . Created 3 years, 7 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 b7337b6fc8f4959b0e0aa8b93aac027faee1682a..b2139a7445c342aeda3dde636e76a47bec79f0c7 100644
--- a/chrome/browser/predictors/resource_prefetch_common_unittest.cc
+++ b/chrome/browser/predictors/resource_prefetch_common_unittest.cc
@@ -49,14 +49,13 @@ class ResourcePrefetchCommonTest : public testing::Test {
profile_->GetPrefs()->SetInteger(prefs::kNetworkPredictionOptions, value);
}
- void TestIsPrefetchEnabledForOrigin(
- const ResourcePrefetchPredictorConfig& config,
- PrefetchOrigin origin) {
+ void TestIsPrefetchEnabledForOrigin(const GlowplugPredictorConfig& config,
+ PrefetchOrigin origin) {
EXPECT_TRUE(config.IsLearningEnabled());
EXPECT_TRUE(config.IsPrefetchingEnabledForOrigin(profile_.get(), origin));
}
- void TestIsPrefetchLearning(const ResourcePrefetchPredictorConfig& config) {
+ void TestIsPrefetchLearning(const GlowplugPredictorConfig& config) {
EXPECT_TRUE(config.IsLearningEnabled());
EXPECT_FALSE(config.IsPrefetchingEnabledForOrigin(
profile_.get(), PrefetchOrigin::EXTERNAL));
@@ -65,7 +64,7 @@ class ResourcePrefetchCommonTest : public testing::Test {
EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U);
}
- void TestIsDefaultExtraConfig(const ResourcePrefetchPredictorConfig& config) {
+ void TestIsDefaultExtraConfig(const GlowplugPredictorConfig& config) {
EXPECT_FALSE(config.IsLowConfidenceForTest());
EXPECT_FALSE(config.IsHighConfidenceForTest());
EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
@@ -85,7 +84,7 @@ ResourcePrefetchCommonTest::ResourcePrefetchCommonTest()
: profile_(new TestingProfile()) {}
TEST_F(ResourcePrefetchCommonTest, IsDisabledByDefault) {
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_FALSE(
IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
@@ -103,7 +102,7 @@ TEST_F(ResourcePrefetchCommonTest, EnableLearning) {
"dummy-trial", {{kModeParamName, kLearningMode}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchLearning(config);
TestIsDefaultExtraConfig(config);
@@ -114,7 +113,7 @@ TEST_F(ResourcePrefetchCommonTest, EnablePrefetch) {
"dummy-trial", {{kModeParamName, kPrefetchingMode}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchEnabledForOrigin(config, PrefetchOrigin::EXTERNAL);
TestIsPrefetchEnabledForOrigin(config, PrefetchOrigin::NAVIGATION);
@@ -126,7 +125,7 @@ TEST_F(ResourcePrefetchCommonTest, EnablePrefetchExternalOnly) {
"dummy-trial", {{kModeParamName, kExternalPrefetchingMode}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchEnabledForOrigin(config, PrefetchOrigin::EXTERNAL);
EXPECT_FALSE(config.IsPrefetchingEnabledForOrigin(
@@ -140,7 +139,7 @@ TEST_F(ResourcePrefetchCommonTest, EnableUrlLearning) {
{{kModeParamName, kLearningMode}, {kEnableUrlLearningParamName, "true"}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchLearning(config);
EXPECT_TRUE(config.is_url_learning_enabled);
@@ -152,7 +151,7 @@ TEST_F(ResourcePrefetchCommonTest, EnableManifests) {
{{kModeParamName, kLearningMode}, {kEnableManifestsParamName, "true"}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchLearning(config);
EXPECT_TRUE(config.is_manifests_enabled);
@@ -165,7 +164,7 @@ TEST_F(ResourcePrefetchCommonTest, EnableOriginLearning) {
{kEnableOriginLearningParamName, "true"}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchLearning(config);
EXPECT_TRUE(config.is_origin_learning_enabled);
@@ -178,7 +177,7 @@ TEST_F(ResourcePrefetchCommonTest, RespectsNetworkSettings) {
"dummy-trial", {{kModeParamName, kPrefetchingMode}},
{kSpeculativeResourcePrefetchingFeatureName});
- ResourcePrefetchPredictorConfig config;
+ GlowplugPredictorConfig config;
EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
TestIsPrefetchEnabledForOrigin(config, PrefetchOrigin::EXTERNAL);
TestIsDefaultExtraConfig(config);

Powered by Google App Engine
This is Rietveld 408576698