OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "base/message_loop.h" |
6 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 6 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
7 #include "chrome/browser/chromeos/cros/mock_update_library.h" | 7 #include "chrome/browser/chromeos/cros/mock_update_library.h" |
8 #include "chrome/browser/chromeos/dbus/mock_dbus_thread_manager.h" | 8 #include "chrome/browser/chromeos/dbus/mock_dbus_thread_manager.h" |
9 #include "chrome/browser/chromeos/dbus/mock_session_manager_client.h" | 9 #include "chrome/browser/chromeos/dbus/mock_session_manager_client.h" |
10 #include "chrome/browser/chromeos/login/mock_screen_observer.h" | 10 #include "chrome/browser/chromeos/login/mock_screen_observer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 EXPECT_CALL(*mock_session_manager_client, EmitLoginPromptReady()) | 46 EXPECT_CALL(*mock_session_manager_client, EmitLoginPromptReady()) |
47 .Times(1); | 47 .Times(1); |
48 | 48 |
49 mock_update_library_ = new MockUpdateLibrary(); | 49 mock_update_library_ = new MockUpdateLibrary(); |
50 cros_mock_->test_api()->SetUpdateLibrary(mock_update_library_, true); | 50 cros_mock_->test_api()->SetUpdateLibrary(mock_update_library_, true); |
51 | 51 |
52 // UpdateScreen::StartUpdate() will be called by the WizardController | 52 // UpdateScreen::StartUpdate() will be called by the WizardController |
53 // just after creating the update screen, so the expectations for that | 53 // just after creating the update screen, so the expectations for that |
54 // should be set up here. | 54 // should be set up here. |
55 EXPECT_CALL(*mock_update_library_, AddObserver(_)) | 55 EXPECT_CALL(*mock_update_library_, AddObserver(_)) |
56 .Times(1); | 56 .Times(AtLeast(1)); |
57 EXPECT_CALL(*mock_update_library_, RemoveObserver(_)) | 57 EXPECT_CALL(*mock_update_library_, RemoveObserver(_)) |
58 .Times(AtLeast(1)); | 58 .Times(AtLeast(1)); |
59 EXPECT_CALL(*mock_update_library_, RequestUpdateCheck(_,_)) | 59 EXPECT_CALL(*mock_update_library_, RequestUpdateCheck(_,_)) |
60 .Times(1) | 60 .Times(1) |
61 .WillOnce(Invoke(RequestUpdateCheckSuccess)); | 61 .WillOnce(Invoke(RequestUpdateCheckSuccess)); |
62 | 62 |
63 mock_network_library_ = cros_mock_->mock_network_library(); | 63 mock_network_library_ = cros_mock_->mock_network_library(); |
64 EXPECT_CALL(*mock_network_library_, Connected()) | 64 EXPECT_CALL(*mock_network_library_, Connected()) |
65 .Times(1) // also called by NetworkMenu::InitMenuItems() | 65 .Times(1) // also called by NetworkMenu::InitMenuItems() |
66 .WillRepeatedly((Return(false))) | 66 .WillRepeatedly((Return(false))) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 EXPECT_CALL(*mock_update_library_, status()) | 209 EXPECT_CALL(*mock_update_library_, status()) |
210 .Times(AtLeast(1)) | 210 .Times(AtLeast(1)) |
211 .WillRepeatedly(ReturnRef(status)); | 211 .WillRepeatedly(ReturnRef(status)); |
212 EXPECT_CALL(*mock_screen_observer_, | 212 EXPECT_CALL(*mock_screen_observer_, |
213 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING)) | 213 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING)) |
214 .Times(1); | 214 .Times(1); |
215 update_screen_->UpdateStatusChanged(status); | 215 update_screen_->UpdateStatusChanged(status); |
216 } | 216 } |
217 | 217 |
218 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |