| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/chromeos/network_state_notifier.h" | 5 #include "chrome/browser/chromeos/network_state_notifier.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_thread.h" | 7 #include "chrome/browser/chrome_thread.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
| 9 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 9 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| 10 #include "chrome/common/notification_registrar.h" |
| 10 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
| 11 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/test/ui_test_utils.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" | |
| 14 #include "chrome/test/ui_test_utils.h" | |
| 15 | 15 |
| 16 namespace chromeos { | 16 namespace chromeos { |
| 17 | 17 |
| 18 using ::testing::Return; | 18 using ::testing::Return; |
| 19 using ::testing::_; | 19 using ::testing::_; |
| 20 | 20 |
| 21 class NetworkStateNotifierTest : public CrosInProcessBrowserTest, | 21 class NetworkStateNotifierTest : public CrosInProcessBrowserTest, |
| 22 public NotificationObserver { | 22 public NotificationObserver { |
| 23 public: | 23 public: |
| 24 NetworkStateNotifierTest() : mock_network_library_(NULL) { | 24 NetworkStateNotifierTest() : mock_network_library_(NULL) { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 .Times(1) | 105 .Times(1) |
| 106 .WillOnce((Return(false))) | 106 .WillOnce((Return(false))) |
| 107 .RetiresOnSaturation(); | 107 .RetiresOnSaturation(); |
| 108 NetworkStateNotifier* notifier = NetworkStateNotifier::Get(); | 108 NetworkStateNotifier* notifier = NetworkStateNotifier::Get(); |
| 109 notifier->NetworkChanged(mock_network_library_); | 109 notifier->NetworkChanged(mock_network_library_); |
| 110 WaitForNotification(); | 110 WaitForNotification(); |
| 111 EXPECT_EQ(chromeos::NetworkStateDetails::DISCONNECTED, state_); | 111 EXPECT_EQ(chromeos::NetworkStateDetails::DISCONNECTED, state_); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace chromeos | 114 } // namespace chromeos |
| OLD | NEW |