| OLD | NEW |
| 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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/net/prediction_options.h" | 9 #include "chrome/browser/net/prediction_options.h" |
| 10 #include "chrome/browser/predictors/resource_prefetch_common.h" | 10 #include "chrome/browser/predictors/resource_prefetch_common.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 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 std::string GetCurrentWiFiSSID() const override { |
| 34 return ""; |
| 35 } |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier { | 38 class MockNetworkChangeNotifier4G : public NetworkChangeNotifier { |
| 36 public: | 39 public: |
| 37 ConnectionType GetCurrentConnectionType() const override { | 40 ConnectionType GetCurrentConnectionType() const override { |
| 38 return NetworkChangeNotifier::CONNECTION_4G; | 41 return NetworkChangeNotifier::CONNECTION_4G; |
| 39 } | 42 } |
| 43 std::string GetCurrentWiFiSSID() const override { |
| 44 return ""; |
| 45 } |
| 40 }; | 46 }; |
| 41 | 47 |
| 42 } // namespace | 48 } // namespace |
| 43 | 49 |
| 44 namespace predictors { | 50 namespace predictors { |
| 45 | 51 |
| 46 class ResourcePrefetchCommonTest : public testing::Test { | 52 class ResourcePrefetchCommonTest : public testing::Test { |
| 47 public: | 53 public: |
| 48 ResourcePrefetchCommonTest(); | 54 ResourcePrefetchCommonTest(); |
| 49 void SetUp() override; | 55 void SetUp() override; |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI); | 329 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifierWIFI); |
| 324 TestIsPrefetchLearning(config); | 330 TestIsPrefetchLearning(config); |
| 325 } | 331 } |
| 326 { | 332 { |
| 327 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G); | 333 scoped_ptr<NetworkChangeNotifier> mock(new MockNetworkChangeNotifier4G); |
| 328 TestIsPrefetchLearning(config); | 334 TestIsPrefetchLearning(config); |
| 329 } | 335 } |
| 330 } | 336 } |
| 331 | 337 |
| 332 } // namespace predictors | 338 } // namespace predictors |
| OLD | NEW |