| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "chrome/browser/chromeos/cros/cros_library.h" | 6 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 7 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 7 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| 8 #include "chrome/browser/chromeos/cros/network_library.h" | 8 #include "chrome/browser/chromeos/cros/network_library.h" |
| 9 #include "chrome/browser/chromeos/login/mock_screen_observer.h" | 9 #include "chrome/browser/chromeos/login/mock_screen_observer.h" |
| 10 #include "chrome/browser/chromeos/login/network_screen.h" | 10 #include "chrome/browser/chromeos/login/network_screen.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); | 49 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); |
| 50 cros_mock_->InitStatusAreaMocks(); | 50 cros_mock_->InitStatusAreaMocks(); |
| 51 mock_network_library_ = cros_mock_->mock_network_library(); | 51 mock_network_library_ = cros_mock_->mock_network_library(); |
| 52 MockSessionManagerClient* mock_session_manager_client = | 52 MockSessionManagerClient* mock_session_manager_client = |
| 53 mock_dbus_thread_manager->mock_session_manager_client(); | 53 mock_dbus_thread_manager->mock_session_manager_client(); |
| 54 cellular_.reset(new NetworkDevice("cellular")); | 54 cellular_.reset(new NetworkDevice("cellular")); |
| 55 EXPECT_CALL(*mock_session_manager_client, EmitLoginPromptReady()) | 55 EXPECT_CALL(*mock_session_manager_client, EmitLoginPromptReady()) |
| 56 .Times(1); | 56 .Times(1); |
| 57 EXPECT_CALL(*mock_session_manager_client, RetrieveDevicePolicy(_)) | 57 EXPECT_CALL(*mock_session_manager_client, RetrieveDevicePolicy(_)) |
| 58 .Times(AnyNumber()); | 58 .Times(AnyNumber()); |
| 59 EXPECT_CALL(*mock_dbus_thread_manager->mock_update_engine_client(), | |
| 60 GetLastStatus()) | |
| 61 .Times(1) | |
| 62 .WillOnce(Return(MockUpdateEngineClient::Status())); | |
| 63 | 59 |
| 64 // Minimal set of expectations needed on NetworkScreen initialization. | 60 // Minimal set of expectations needed on NetworkScreen initialization. |
| 65 // Status bar expectations are defined with RetiresOnSaturation() so | 61 // Status bar expectations are defined with RetiresOnSaturation() so |
| 66 // these mocks will be active once status bar is initialized. | 62 // these mocks will be active once status bar is initialized. |
| 67 EXPECT_CALL(*mock_network_library_, AddUserActionObserver(_)) | 63 EXPECT_CALL(*mock_network_library_, AddUserActionObserver(_)) |
| 68 .Times(AnyNumber()); | 64 .Times(AnyNumber()); |
| 69 EXPECT_CALL(*mock_network_library_, wifi_connected()) | 65 EXPECT_CALL(*mock_network_library_, wifi_connected()) |
| 70 .Times(1) | 66 .Times(1) |
| 71 .WillRepeatedly(Return(false)); | 67 .WillRepeatedly(Return(false)); |
| 72 EXPECT_CALL(*mock_network_library_, FindWifiDevice()) | 68 EXPECT_CALL(*mock_network_library_, FindWifiDevice()) |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // EXPECT_FALSE(actor_->IsConnecting()); | 276 // EXPECT_FALSE(actor_->IsConnecting()); |
| 281 network_screen_->OnConnectionTimeout(); | 277 network_screen_->OnConnectionTimeout(); |
| 282 | 278 |
| 283 // Close infobubble with error message - it makes the test stable. | 279 // Close infobubble with error message - it makes the test stable. |
| 284 // EXPECT_FALSE(actor_->IsContinueEnabled()); | 280 // EXPECT_FALSE(actor_->IsContinueEnabled()); |
| 285 // EXPECT_FALSE(actor_->IsConnecting()); | 281 // EXPECT_FALSE(actor_->IsConnecting()); |
| 286 // actor_->ClearErrors(); | 282 // actor_->ClearErrors(); |
| 287 } | 283 } |
| 288 | 284 |
| 289 } // namespace chromeos | 285 } // namespace chromeos |
| OLD | NEW |