Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/cros/mock_login_library.h" | 5 #include "chrome/browser/chromeos/cros/mock_login_library.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/login/mock_screen_observer.h" | 8 #include "chrome/browser/chromeos/login/mock_screen_observer.h" |
| 9 #include "chrome/browser/chromeos/login/update_screen.h" | 9 #include "chrome/browser/chromeos/login/update_screen.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 11 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" | 11 #include "chrome/browser/chromeos/login/wizard_in_process_browser_test.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 using ::testing::_; | 15 using ::testing::_; |
| 16 using ::testing::AnyNumber; | |
| 16 using ::testing::AtLeast; | 17 using ::testing::AtLeast; |
| 17 using ::testing::Return; | 18 using ::testing::Return; |
| 18 using ::testing::ReturnRef; | 19 using ::testing::ReturnRef; |
| 19 using ::testing::Invoke; | 20 using ::testing::Invoke; |
| 20 | 21 |
| 21 static void RequestUpdateCheckSuccess(UpdateCallback callback, void* userdata) { | 22 static void RequestUpdateCheckSuccess(UpdateCallback callback, void* userdata) { |
| 22 callback(userdata, chromeos::UPDATE_RESULT_SUCCESS, NULL); | 23 callback(userdata, chromeos::UPDATE_RESULT_SUCCESS, NULL); |
| 23 } | 24 } |
| 24 | 25 |
| 25 class UpdateScreenTest : public WizardInProcessBrowserTest { | 26 class UpdateScreenTest : public WizardInProcessBrowserTest { |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 56 .WillOnce(Invoke(RequestUpdateCheckSuccess)); | 57 .WillOnce(Invoke(RequestUpdateCheckSuccess)); |
| 57 | 58 |
| 58 mock_network_library_ = cros_mock_->mock_network_library(); | 59 mock_network_library_ = cros_mock_->mock_network_library(); |
| 59 EXPECT_CALL(*mock_network_library_, Connected()) | 60 EXPECT_CALL(*mock_network_library_, Connected()) |
| 60 .Times(1) // also called by NetworkMenu::InitMenuItems() | 61 .Times(1) // also called by NetworkMenu::InitMenuItems() |
| 61 .WillRepeatedly((Return(false))) | 62 .WillRepeatedly((Return(false))) |
| 62 .RetiresOnSaturation(); | 63 .RetiresOnSaturation(); |
| 63 EXPECT_CALL(*mock_network_library_, AddNetworkManagerObserver(_)) | 64 EXPECT_CALL(*mock_network_library_, AddNetworkManagerObserver(_)) |
| 64 .Times(1) | 65 .Times(1) |
| 65 .RetiresOnSaturation(); | 66 .RetiresOnSaturation(); |
| 67 EXPECT_CALL(*mock_network_library_, FindWifiDevice()).Times(AnyNumber()); | |
|
stevenjb
2011/04/26 17:05:08
nit: we generally put each .Times, etc on a new li
Denis Lagno
2011/04/26 18:04:09
Done.
| |
| 68 EXPECT_CALL(*mock_network_library_, FindEthernetDevice()) | |
| 69 .Times(AnyNumber()); | |
| 66 } | 70 } |
| 67 | 71 |
| 68 virtual void TearDownInProcessBrowserTestFixture() { | 72 virtual void TearDownInProcessBrowserTestFixture() { |
| 69 cros_mock_->test_api()->SetUpdateLibrary(NULL, true); | 73 cros_mock_->test_api()->SetUpdateLibrary(NULL, true); |
| 70 WizardInProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 74 WizardInProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
| 71 } | 75 } |
| 72 | 76 |
| 73 MockLoginLibrary* mock_login_library_; | 77 MockLoginLibrary* mock_login_library_; |
| 74 MockUpdateLibrary* mock_update_library_; | 78 MockUpdateLibrary* mock_update_library_; |
| 75 MockNetworkLibrary* mock_network_library_; | 79 MockNetworkLibrary* mock_network_library_; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 .WillRepeatedly(ReturnRef(status)); | 253 .WillRepeatedly(ReturnRef(status)); |
| 250 EXPECT_CALL(*mock_screen_observer, | 254 EXPECT_CALL(*mock_screen_observer, |
| 251 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING)) | 255 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING)) |
| 252 .Times(1); | 256 .Times(1); |
| 253 update_screen->UpdateStatusChanged(mock_update_library_); | 257 update_screen->UpdateStatusChanged(mock_update_library_); |
| 254 | 258 |
| 255 controller()->set_observer(NULL); | 259 controller()->set_observer(NULL); |
| 256 } | 260 } |
| 257 | 261 |
| 258 } // namespace chromeos | 262 } // namespace chromeos |
| OLD | NEW |