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

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

Issue 1712943002: [Android] Simplify "network predictions" preference to a boolean value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added bug link; rebased Created 4 years, 10 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 unified diff | Download patch
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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/metrics/statistics_recorder.h" 7 #include "base/metrics/statistics_recorder.h"
8 #include "chrome/browser/net/prediction_options.h" 8 #include "chrome/browser/net/prediction_options.h"
9 #include "chrome/browser/predictors/resource_prefetch_common.h" 9 #include "chrome/browser/predictors/resource_prefetch_common.h"
10 #include "chrome/browser/predictors/resource_prefetch_predictor.h" 10 #include "chrome/browser/predictors/resource_prefetch_predictor.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_WIFI_ONLY); 298 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_WIFI_ONLY);
299 { 299 {
300 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI); 300 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI);
301 TestIsPrefetchEnabled(config); 301 TestIsPrefetchEnabled(config);
302 } 302 }
303 { 303 {
304 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G); 304 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G);
305 TestIsPrefetchLearning(config); 305 TestIsPrefetchLearning(config);
306 } 306 }
307 307
308 // Set preference to ALWAYS: always prefetch.
309 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_ALWAYS);
310 {
311 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI);
312 TestIsPrefetchEnabled(config);
313 }
314 {
315 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G);
316 TestIsPrefetchEnabled(config);
317 }
318
319 // Set preference to NEVER: never prefetch. 308 // Set preference to NEVER: never prefetch.
320 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_NEVER); 309 SetPreference(NetworkPredictionOptions::NETWORK_PREDICTION_NEVER);
321 { 310 {
322 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI); 311 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI);
323 TestIsPrefetchLearning(config); 312 TestIsPrefetchLearning(config);
324 } 313 }
325 { 314 {
326 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G); 315 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G);
327 TestIsPrefetchLearning(config); 316 TestIsPrefetchLearning(config);
328 } 317 }
329 } 318 }
330 319
331 } // namespace predictors 320 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/net/prediction_options.cc ('k') | chrome/browser/prefetch/prefetch_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698