Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: chrome/browser/chromeos/login/update_screen_browsertest.cc

Issue 6648009: Modify UpdateLibrary to use async RequestUpdateCheck call (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/update_screen_browsertest.cc
diff --git a/chrome/browser/chromeos/login/update_screen_browsertest.cc b/chrome/browser/chromeos/login/update_screen_browsertest.cc
index 5fa4eb11256367cea803de6b53e457b8b6bb7403..c6897bd6a789d2b424fc4af29d097b2032fc571c 100644
--- a/chrome/browser/chromeos/login/update_screen_browsertest.cc
+++ b/chrome/browser/chromeos/login/update_screen_browsertest.cc
@@ -16,6 +16,11 @@ using ::testing::_;
using ::testing::AtLeast;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::Invoke;
+
+static void RequestUpdateCheckSuccess(UpdateCallback callback, void* userdata) {
+ callback(userdata, chromeos::UPDATE_RESULT_SUCCESS, NULL);
+}
class UpdateScreenTest : public WizardInProcessBrowserTest {
public:
@@ -46,9 +51,9 @@ class UpdateScreenTest : public WizardInProcessBrowserTest {
.Times(1);
EXPECT_CALL(*mock_update_library_, RemoveObserver(_))
.Times(AtLeast(1));
- EXPECT_CALL(*mock_update_library_, CheckForUpdate())
+ EXPECT_CALL(*mock_update_library_, RequestUpdateCheck(_,_))
.Times(1)
- .WillOnce(Return(true));
+ .WillOnce(Invoke(RequestUpdateCheckSuccess));
mock_network_library_ = cros_mock_->mock_network_library();
EXPECT_CALL(*mock_network_library_, Connected())
@@ -165,6 +170,10 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestUpdateAvailable) {
controller()->set_observer(NULL);
}
+static void RequestUpdateCheckFail(UpdateCallback callback, void* userdata) {
+ callback(userdata, chromeos::UPDATE_RESULT_FAILED, NULL);
+}
+
IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) {
ASSERT_TRUE(controller() != NULL);
scoped_ptr<MockScreenObserver> mock_screen_observer(new MockScreenObserver());
@@ -185,9 +194,9 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestErrorIssuingUpdateCheck) {
.Times(1);
EXPECT_CALL(*mock_update_library_, RemoveObserver(_))
.Times(AtLeast(1));
- EXPECT_CALL(*mock_update_library_, CheckForUpdate())
+ EXPECT_CALL(*mock_update_library_, RequestUpdateCheck(_,_))
.Times(1)
- .WillOnce(Return(false));
+ .WillOnce(Invoke(RequestUpdateCheckFail));
EXPECT_CALL(*mock_screen_observer,
OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE))
.Times(1);
« no previous file with comments | « chrome/browser/chromeos/login/update_screen.cc ('k') | chrome/browser/ui/webui/options/about_page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698