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

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

Issue 899573002: Add WiFi SSID getter to NetworkChangeNotifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 5 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
« no previous file with comments | « no previous file | chrome/browser/prefetch/prefetch_browsertest.cc » ('j') | 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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefetch/prefetch_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698