OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/prefs/testing_pref_service.h" | 5 #include "base/prefs/testing_pref_service.h" |
6 #include "components/web_resource/eula_accepted_notifier.h" | 6 #include "components/web_resource/eula_accepted_notifier.h" |
7 #include "components/web_resource/resource_request_allowed_notifier_test_util.h" | 7 #include "components/web_resource/resource_request_allowed_notifier_test_util.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace web_resource { | 10 namespace web_resource { |
(...skipping 13 matching lines...) Expand all Loading... |
24 net::NetworkChangeNotifier::ConnectionType type) { | 24 net::NetworkChangeNotifier::ConnectionType type) { |
25 connection_type_to_return_ = type; | 25 connection_type_to_return_ = type; |
26 net::NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); | 26 net::NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); |
27 base::MessageLoop::current()->RunUntilIdle(); | 27 base::MessageLoop::current()->RunUntilIdle(); |
28 } | 28 } |
29 | 29 |
30 private: | 30 private: |
31 ConnectionType GetCurrentConnectionType() const override { | 31 ConnectionType GetCurrentConnectionType() const override { |
32 return connection_type_to_return_; | 32 return connection_type_to_return_; |
33 } | 33 } |
| 34 std::string GetCurrentWiFiSSID() const override { |
| 35 return ""; |
| 36 } |
34 | 37 |
35 // The currently simulated network connection type. If this is set to | 38 // The currently simulated network connection type. If this is set to |
36 // CONNECTION_NONE, then NetworkChangeNotifier::IsOffline will return true. | 39 // CONNECTION_NONE, then NetworkChangeNotifier::IsOffline will return true. |
37 net::NetworkChangeNotifier::ConnectionType connection_type_to_return_; | 40 net::NetworkChangeNotifier::ConnectionType connection_type_to_return_; |
38 | 41 |
39 DISALLOW_COPY_AND_ASSIGN(TestNetworkChangeNotifier); | 42 DISALLOW_COPY_AND_ASSIGN(TestNetworkChangeNotifier); |
40 }; | 43 }; |
41 | 44 |
42 // EulaAcceptedNotifier test class that allows mocking the EULA accepted state | 45 // EulaAcceptedNotifier test class that allows mocking the EULA accepted state |
43 // and issuing simulated notifications. | 46 // and issuing simulated notifications. |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 DisableEulaAndNetwork(); | 272 DisableEulaAndNetwork(); |
270 | 273 |
271 SimulateNetworkConnectionChange(net::NetworkChangeNotifier::CONNECTION_WIFI); | 274 SimulateNetworkConnectionChange(net::NetworkChangeNotifier::CONNECTION_WIFI); |
272 EXPECT_FALSE(was_notified()); | 275 EXPECT_FALSE(was_notified()); |
273 | 276 |
274 SimulateEulaAccepted(); | 277 SimulateEulaAccepted(); |
275 EXPECT_FALSE(was_notified()); | 278 EXPECT_FALSE(was_notified()); |
276 } | 279 } |
277 | 280 |
278 } // namespace web_resource | 281 } // namespace web_resource |
OLD | NEW |