OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/metrics/variations/resource_request_allowed_notifier_te
st_util.h" | 6 #include "chrome/browser/metrics/variations/resource_request_allowed_notifier_te
st_util.h" |
6 #include "chrome/common/chrome_notification_types.h" | 7 #include "chrome/common/chrome_notification_types.h" |
7 #include "chrome/test/base/testing_browser_process.h" | 8 #include "chrome/test/base/testing_browser_process.h" |
8 #include "chrome/test/base/testing_pref_service.h" | |
9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 // Override NetworkChangeNotifier to simulate connection type changes for tests. | 13 // Override NetworkChangeNotifier to simulate connection type changes for tests. |
14 class TestNetworkChangeNotifier : public net::NetworkChangeNotifier { | 14 class TestNetworkChangeNotifier : public net::NetworkChangeNotifier { |
15 public: | 15 public: |
16 TestNetworkChangeNotifier() | 16 TestNetworkChangeNotifier() |
17 : net::NetworkChangeNotifier(), | 17 : net::NetworkChangeNotifier(), |
18 connection_type_to_return_( | 18 connection_type_to_return_( |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 DisableEulaAndNetwork(); | 235 DisableEulaAndNetwork(); |
236 | 236 |
237 SimulateNetworkConnectionChange( | 237 SimulateNetworkConnectionChange( |
238 net::NetworkChangeNotifier::CONNECTION_WIFI); | 238 net::NetworkChangeNotifier::CONNECTION_WIFI); |
239 EXPECT_FALSE(was_notified()); | 239 EXPECT_FALSE(was_notified()); |
240 | 240 |
241 SimulateEulaAccepted(); | 241 SimulateEulaAccepted(); |
242 EXPECT_FALSE(was_notified()); | 242 EXPECT_FALSE(was_notified()); |
243 } | 243 } |
244 #endif // OS_CHROMEOS | 244 #endif // OS_CHROMEOS |
OLD | NEW |