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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_common_unittest.cc

Issue 2532933002: predictors: Remove unused field trial configuration parsing. (Closed)
Patch Set: Address comments. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory>
6 #include <string>
7
8 #include "base/command_line.h"
5 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
6 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
7 #include "base/metrics/field_trial.h"
8 #include "base/metrics/statistics_recorder.h"
9 #include "chrome/browser/net/prediction_options.h" 11 #include "chrome/browser/net/prediction_options.h"
10 #include "chrome/browser/predictors/resource_prefetch_common.h" 12 #include "chrome/browser/predictors/resource_prefetch_common.h"
11 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 13 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
12 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser.h" 15 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
16 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
17 #include "components/prefs/pref_service.h" 18 #include "components/prefs/pref_service.h"
18 #include "components/variations/entropy_provider.h"
19 #include "content/public/test/test_browser_thread.h" 19 #include "content/public/test/test_browser_thread.h"
20 #include "net/base/network_change_notifier.h" 20 #include "net/base/network_change_notifier.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 22
23 using chrome_browser_net::NetworkPredictionOptions; 23 using chrome_browser_net::NetworkPredictionOptions;
24 using net::NetworkChangeNotifier; 24 using net::NetworkChangeNotifier;
25 25
26 namespace { 26 namespace {
27 27
28 class MockNetworkChangeNotifierWIFI : public NetworkChangeNotifier { 28 class MockNetworkChangeNotifierWIFI : public NetworkChangeNotifier {
29 public: 29 public:
30 ConnectionType GetCurrentConnectionType() const override { 30 ConnectionType GetCurrentConnectionType() const override {
31 return NetworkChangeNotifier::CONNECTION_WIFI; 31 return NetworkChangeNotifier::CONNECTION_WIFI;
32 } 32 }
33 }; 33 };
34 34
35 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier { 35 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier {
36 public: 36 public:
37 ConnectionType GetCurrentConnectionType() const override { 37 ConnectionType GetCurrentConnectionType() const override {
38 return NetworkChangeNotifier::CONNECTION_4G; 38 return NetworkChangeNotifier::CONNECTION_4G;
39 } 39 }
40 }; 40 };
41 41
42 } // namespace 42 } // namespace
43 43
44 namespace predictors { 44 namespace predictors {
45 45
46 class ResourcePrefetchCommonTest : public testing::Test { 46 class ResourcePrefetchCommonTest : public testing::Test {
47 public: 47 public:
48 ResourcePrefetchCommonTest(); 48 ResourcePrefetchCommonTest();
49 void SetUp() override;
50
51 void CreateTestFieldTrial(const std::string& name,
52 const std::string& group_name) {
53 base::FieldTrial* trial = base::FieldTrialList::CreateFieldTrial(
54 name, group_name);
55 trial->group();
56 }
57 49
58 void SetPreference(NetworkPredictionOptions value) { 50 void SetPreference(NetworkPredictionOptions value) {
59 profile_->GetPrefs()->SetInteger(prefs::kNetworkPredictionOptions, value); 51 profile_->GetPrefs()->SetInteger(prefs::kNetworkPredictionOptions, value);
60 } 52 }
61 53
62 void TestIsPrefetchDisabled(ResourcePrefetchPredictorConfig& config) { 54 void SetCommandLineValue(const std::string& value) {
63 EXPECT_FALSE(config.IsLearningEnabled()); 55 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
64 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); 56 switches::kSpeculativeResourcePrefetching, value);
65 EXPECT_FALSE(config.IsURLLearningEnabled());
66 EXPECT_FALSE(config.IsHostLearningEnabled());
67 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get()));
68 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get()));
69 } 57 }
70 58
71 void TestIsPrefetchEnabled(ResourcePrefetchPredictorConfig& config) { 59 void TestIsPrefetchEnabled(const ResourcePrefetchPredictorConfig& config) {
72 EXPECT_TRUE(config.IsLearningEnabled()); 60 EXPECT_TRUE(config.IsLearningEnabled());
73 EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get())); 61 EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get()));
74 EXPECT_TRUE(config.IsURLLearningEnabled()); 62 EXPECT_TRUE(config.IsURLLearningEnabled());
75 EXPECT_TRUE(config.IsHostLearningEnabled()); 63 EXPECT_TRUE(config.IsHostLearningEnabled());
76 EXPECT_TRUE(config.IsURLPrefetchingEnabled(profile_.get())); 64 EXPECT_TRUE(config.IsURLPrefetchingEnabled(profile_.get()));
77 EXPECT_TRUE(config.IsHostPrefetchingEnabled(profile_.get())); 65 EXPECT_TRUE(config.IsHostPrefetchingEnabled(profile_.get()));
78 } 66 }
79 67
80 void TestIsPrefetchLearning(ResourcePrefetchPredictorConfig& config) { 68 void TestIsPrefetchLearning(const ResourcePrefetchPredictorConfig& config) {
81 EXPECT_TRUE(config.IsLearningEnabled()); 69 EXPECT_TRUE(config.IsLearningEnabled());
82 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); 70 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get()));
83 EXPECT_TRUE(config.IsURLLearningEnabled()); 71 EXPECT_TRUE(config.IsURLLearningEnabled());
84 EXPECT_TRUE(config.IsHostLearningEnabled()); 72 EXPECT_TRUE(config.IsHostLearningEnabled());
85 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); 73 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get()));
86 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); 74 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get()));
87 } 75 }
88 76
89 void TestIsDefaultExtraConfig(ResourcePrefetchPredictorConfig& config) { 77 void TestIsDefaultExtraConfig(const ResourcePrefetchPredictorConfig& config) {
90 EXPECT_FALSE(config.IsLowConfidenceForTest()); 78 EXPECT_FALSE(config.IsLowConfidenceForTest());
91 EXPECT_FALSE(config.IsHighConfidenceForTest()); 79 EXPECT_FALSE(config.IsHighConfidenceForTest());
92 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); 80 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
93 EXPECT_FALSE(config.IsSmallDBEnabledForTest()); 81 EXPECT_FALSE(config.IsSmallDBEnabledForTest());
94 } 82 }
95 83
96 protected: 84 protected:
97 base::MessageLoop loop_; 85 base::MessageLoop loop_;
98 content::TestBrowserThread ui_thread_; 86 content::TestBrowserThread ui_thread_;
99 std::unique_ptr<TestingProfile> profile_; 87 std::unique_ptr<TestingProfile> profile_;
100
101 private:
102 std::unique_ptr<base::FieldTrialList> field_trial_list_;
103 }; 88 };
104 89
105 ResourcePrefetchCommonTest::ResourcePrefetchCommonTest() 90 ResourcePrefetchCommonTest::ResourcePrefetchCommonTest()
106 : loop_(base::MessageLoop::TYPE_DEFAULT), 91 : loop_(base::MessageLoop::TYPE_DEFAULT),
107 ui_thread_(content::BrowserThread::UI, &loop_), 92 ui_thread_(content::BrowserThread::UI, &loop_),
108 profile_(new TestingProfile()) { } 93 profile_(new TestingProfile()) { }
109 94
110 void ResourcePrefetchCommonTest::SetUp() { 95 TEST_F(ResourcePrefetchCommonTest, IsDisabledByDefault) {
111 field_trial_list_.reset(new base::FieldTrialList(
112 base::MakeUnique<metrics::SHA1EntropyProvider>(
113 "ResourcePrefetchCommonTest")));
114 base::StatisticsRecorder::Initialize();
115 }
116
117 TEST_F(ResourcePrefetchCommonTest, FieldTrialNotSpecified) {
118 ResourcePrefetchPredictorConfig config; 96 ResourcePrefetchPredictorConfig config;
119 EXPECT_FALSE( 97 EXPECT_FALSE(
120 IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); 98 IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
121 TestIsPrefetchDisabled(config);
122 }
123 99
124 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingDisabled) { 100 EXPECT_FALSE(config.IsLearningEnabled());
125 CreateTestFieldTrial("SpeculativeResourcePrefetching",
126 "Prefetching=Disabled");
127 ResourcePrefetchPredictorConfig config;
128 EXPECT_FALSE(
129 IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
130 TestIsPrefetchDisabled(config);
131 }
132
133 TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningHost) {
134 CreateTestFieldTrial("SpeculativeResourcePrefetching",
135 "Prefetching=Learning:Predictor=Host");
136 ResourcePrefetchPredictorConfig config;
137 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
138 EXPECT_TRUE(config.IsLearningEnabled());
139 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get())); 101 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get()));
140 EXPECT_FALSE(config.IsURLLearningEnabled()); 102 EXPECT_FALSE(config.IsURLLearningEnabled());
141 EXPECT_TRUE(config.IsHostLearningEnabled()); 103 EXPECT_FALSE(config.IsHostLearningEnabled());
142 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get())); 104 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get()));
143 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get())); 105 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get()));
106
144 TestIsDefaultExtraConfig(config); 107 TestIsDefaultExtraConfig(config);
145 } 108 }
146 109
147 TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningURL) { 110 TEST_F(ResourcePrefetchCommonTest, EnableLearning) {
148 CreateTestFieldTrial("SpeculativeResourcePrefetching", 111 SetCommandLineValue("learning");
149 "Prefetching=Learning:Predictor=Url");
150 ResourcePrefetchPredictorConfig config;
151 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
152 EXPECT_TRUE(config.IsLearningEnabled());
153 EXPECT_FALSE(config.IsPrefetchingEnabled(profile_.get()));
154 EXPECT_TRUE(config.IsURLLearningEnabled());
155 EXPECT_FALSE(config.IsHostLearningEnabled());
156 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get()));
157 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get()));
158 TestIsDefaultExtraConfig(config);
159 }
160
161 TEST_F(ResourcePrefetchCommonTest, FieldTrialLearning) {
162 CreateTestFieldTrial("SpeculativeResourcePrefetching",
163 "Prefetching=Learning");
164 ResourcePrefetchPredictorConfig config; 112 ResourcePrefetchPredictorConfig config;
165 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); 113 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
166 TestIsPrefetchLearning(config); 114 TestIsPrefetchLearning(config);
167 TestIsDefaultExtraConfig(config); 115 TestIsDefaultExtraConfig(config);
168 } 116 }
169 117
170 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingHost) { 118 TEST_F(ResourcePrefetchCommonTest, EnablePrefetch) {
171 CreateTestFieldTrial("SpeculativeResourcePrefetching", 119 SetCommandLineValue("enabled");
172 "Prefetching=Enabled:Predictor=Host");
173 ResourcePrefetchPredictorConfig config;
174 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
175 EXPECT_TRUE(config.IsLearningEnabled());
176 EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get()));
177 EXPECT_FALSE(config.IsURLLearningEnabled());
178 EXPECT_TRUE(config.IsHostLearningEnabled());
179 EXPECT_FALSE(config.IsURLPrefetchingEnabled(profile_.get()));
180 EXPECT_TRUE(config.IsHostPrefetchingEnabled(profile_.get()));
181 TestIsDefaultExtraConfig(config);
182 }
183
184 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingURL) {
185 CreateTestFieldTrial("SpeculativeResourcePrefetching",
186 "Prefetching=Enabled:Predictor=Url");
187 ResourcePrefetchPredictorConfig config;
188 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
189 EXPECT_TRUE(config.IsLearningEnabled());
190 EXPECT_TRUE(config.IsPrefetchingEnabled(profile_.get()));
191 EXPECT_TRUE(config.IsURLLearningEnabled());
192 EXPECT_FALSE(config.IsHostLearningEnabled());
193 EXPECT_TRUE(config.IsURLPrefetchingEnabled(profile_.get()));
194 EXPECT_FALSE(config.IsHostPrefetchingEnabled(profile_.get()));
195 TestIsDefaultExtraConfig(config);
196 }
197
198 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetching) {
199 CreateTestFieldTrial("SpeculativeResourcePrefetching", "Prefetching=Enabled");
200 ResourcePrefetchPredictorConfig config; 120 ResourcePrefetchPredictorConfig config;
201 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); 121 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
202 TestIsPrefetchEnabled(config); 122 TestIsPrefetchEnabled(config);
203 TestIsDefaultExtraConfig(config); 123 TestIsDefaultExtraConfig(config);
204 } 124 }
205 125
206 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingLowConfidence) { 126 // Verifies whether prefetching is disabled according to the network type. But
207 CreateTestFieldTrial("SpeculativeResourcePrefetching", 127 // learning should not be disabled by network.
208 "Prefetching=Enabled:Confidence=Low"); 128 TEST_F(ResourcePrefetchCommonTest, RespectsNetworkSettings) {
129 SetCommandLineValue("enabled");
209 ResourcePrefetchPredictorConfig config; 130 ResourcePrefetchPredictorConfig config;
210 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config)); 131 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
211 TestIsPrefetchEnabled(config); 132 TestIsPrefetchEnabled(config);
212 EXPECT_TRUE(config.IsLowConfidenceForTest()); 133 TestIsDefaultExtraConfig(config);
213 EXPECT_FALSE(config.IsHighConfidenceForTest());
214 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
215 EXPECT_FALSE(config.IsSmallDBEnabledForTest());
216 }
217
218 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingHighConfidence) {
219 CreateTestFieldTrial("SpeculativeResourcePrefetching",
220 "Prefetching=Enabled:Confidence=High");
221 ResourcePrefetchPredictorConfig config;
222 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
223 TestIsPrefetchEnabled(config);
224 EXPECT_FALSE(config.IsLowConfidenceForTest());
225 EXPECT_TRUE(config.IsHighConfidenceForTest());
226 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
227 EXPECT_FALSE(config.IsSmallDBEnabledForTest());
228 }
229
230 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingMoreResources) {
231 CreateTestFieldTrial("SpeculativeResourcePrefetching",
232 "Prefetching=Learning:MoreResources=Enabled");
233 ResourcePrefetchPredictorConfig config;
234 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
235 TestIsPrefetchLearning(config);
236 EXPECT_FALSE(config.IsLowConfidenceForTest());
237 EXPECT_FALSE(config.IsHighConfidenceForTest());
238 EXPECT_TRUE(config.IsMoreResourcesEnabledForTest());
239 EXPECT_FALSE(config.IsSmallDBEnabledForTest());
240 }
241
242 TEST_F(ResourcePrefetchCommonTest, FieldTrialLearningSmallDB) {
243 CreateTestFieldTrial("SpeculativeResourcePrefetching",
244 "Prefetching=Learning:SmallDB=Enabled");
245 ResourcePrefetchPredictorConfig config;
246 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
247 TestIsPrefetchLearning(config);
248 EXPECT_FALSE(config.IsLowConfidenceForTest());
249 EXPECT_FALSE(config.IsHighConfidenceForTest());
250 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
251 EXPECT_TRUE(config.IsSmallDBEnabledForTest());
252 }
253
254 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDB) {
255 CreateTestFieldTrial("SpeculativeResourcePrefetching",
256 "Prefetching=Enabled:SmallDB=Enabled");
257 ResourcePrefetchPredictorConfig config;
258 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
259 TestIsPrefetchEnabled(config);
260 EXPECT_FALSE(config.IsLowConfidenceForTest());
261 EXPECT_FALSE(config.IsHighConfidenceForTest());
262 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
263 EXPECT_TRUE(config.IsSmallDBEnabledForTest());
264 }
265
266 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDBLowConfidence) {
267 CreateTestFieldTrial("SpeculativeResourcePrefetching",
268 "Prefetching=Enabled:SmallDB=Enabled:Confidence=Low");
269 ResourcePrefetchPredictorConfig config;
270 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
271 TestIsPrefetchEnabled(config);
272 EXPECT_TRUE(config.IsLowConfidenceForTest());
273 EXPECT_FALSE(config.IsHighConfidenceForTest());
274 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
275 EXPECT_TRUE(config.IsSmallDBEnabledForTest());
276 }
277
278 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingSmallDBHighConfidence) {
279 CreateTestFieldTrial("SpeculativeResourcePrefetching",
280 "Prefetching=Enabled:SmallDB=Enabled:Confidence=High");
281 ResourcePrefetchPredictorConfig config;
282 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
283 TestIsPrefetchEnabled(config);
284 EXPECT_FALSE(config.IsLowConfidenceForTest());
285 EXPECT_TRUE(config.IsHighConfidenceForTest());
286 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
287 EXPECT_TRUE(config.IsSmallDBEnabledForTest());
288 }
289
290 // Verifies whether prefetching in the field trial is disabled according to
291 // the network type. But learning should not be disabled by network.
292 TEST_F(ResourcePrefetchCommonTest, FieldTrialPrefetchingDisabledByNetwork) {
293 CreateTestFieldTrial("SpeculativeResourcePrefetching",
294 "Prefetching=Enabled");
295 ResourcePrefetchPredictorConfig config;
296 EXPECT_TRUE(IsSpeculativeResourcePrefetchingEnabled(profile_.get(), &config));
297 TestIsPrefetchEnabled(config);
298 134
299 // Set preference to WIFI_ONLY: prefetch when not on cellular. 135 // Set preference to WIFI_ONLY: prefetch when not on cellular.
300 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_WIFI_ONLY); 136 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_WIFI_ONLY);
301 { 137 {
302 std::unique_ptr<NetworkChangeNotifier> mock( 138 std::unique_ptr<NetworkChangeNotifier> mock(
303 new MockNetworkChangeNotifierWIFI); 139 new MockNetworkChangeNotifierWIFI);
304 TestIsPrefetchEnabled(config); 140 TestIsPrefetchEnabled(config);
305 } 141 }
306 { 142 {
307 std::unique_ptr<NetworkChangeNotifier> mock( 143 std::unique_ptr<NetworkChangeNotifier> mock(
308 new MockNetworkChangeNotifier4G); 144 new MockNetworkChangeNotifier4G);
309 TestIsPrefetchLearning(config); 145 TestIsPrefetchLearning(config);
310 } 146 }
311 147
312 // Set preference to NEVER: never prefetch. 148 // Set preference to NEVER: never prefetch.
313 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_NEVER); 149 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_NEVER);
314 { 150 {
315 std::unique_ptr<NetworkChangeNotifier> mock( 151 std::unique_ptr<NetworkChangeNotifier> mock(
316 new MockNetworkChangeNotifierWIFI); 152 new MockNetworkChangeNotifierWIFI);
317 TestIsPrefetchLearning(config); 153 TestIsPrefetchLearning(config);
318 } 154 }
319 { 155 {
320 std::unique_ptr<NetworkChangeNotifier> mock( 156 std::unique_ptr<NetworkChangeNotifier> mock(
321 new MockNetworkChangeNotifier4G); 157 new MockNetworkChangeNotifier4G);
322 TestIsPrefetchLearning(config); 158 TestIsPrefetchLearning(config);
323 } 159 }
324 } 160 }
325 161
326 } // namespace predictors 162 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698