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

Side by Side Diff: chrome/browser/chromeos/login/update_screen_browsertest.cc

Issue 7057055: Show progress bar as soon as update state changed to UPDATE_STATUS_UPDATE_AVAILABLE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 }; 97 };
98 98
99 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestBasic) { 99 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestBasic) {
100 ASSERT_TRUE(update_screen_->actor_ != NULL); 100 ASSERT_TRUE(update_screen_->actor_ != NULL);
101 } 101 }
102 102
103 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestNoUpdate) { 103 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestNoUpdate) {
104 UpdateLibrary::Status status; 104 UpdateLibrary::Status status;
105 status.status = UPDATE_STATUS_IDLE; 105 status.status = UPDATE_STATUS_IDLE;
106 EXPECT_CALL(*mock_update_library_, status()) 106 EXPECT_CALL(*mock_update_library_, status())
107 .Times(1)
108 .WillRepeatedly(ReturnRef(status));
109 update_screen_->UpdateStatusChanged(mock_update_library_);
110 status.status = UPDATE_STATUS_CHECKING_FOR_UPDATE;
111 EXPECT_CALL(*mock_update_library_, status())
112 .Times(1)
113 .WillRepeatedly(ReturnRef(status));
114 update_screen_->UpdateStatusChanged(mock_update_library_);
115 status.status = UPDATE_STATUS_IDLE;
116 EXPECT_CALL(*mock_update_library_, status())
107 .Times(AtLeast(1)) 117 .Times(AtLeast(1))
108 .WillRepeatedly(ReturnRef(status)); 118 .WillRepeatedly(ReturnRef(status));
109 EXPECT_CALL(*mock_screen_observer_, OnExit(ScreenObserver::UPDATE_NOUPDATE)) 119 EXPECT_CALL(*mock_screen_observer_, OnExit(ScreenObserver::UPDATE_NOUPDATE))
110 .Times(1); 120 .Times(1);
111 update_screen_->UpdateStatusChanged(mock_update_library_); 121 update_screen_->UpdateStatusChanged(mock_update_library_);
112 } 122 }
113 123
114 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestUpdateAvailable) { 124 IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestUpdateAvailable) {
115 update_screen_->is_ignore_update_deadlines_ = true; 125 update_screen_->is_ignore_update_deadlines_ = true;
116 126
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 EXPECT_CALL(*mock_update_library_, status()) 223 EXPECT_CALL(*mock_update_library_, status())
214 .Times(AtLeast(1)) 224 .Times(AtLeast(1))
215 .WillRepeatedly(ReturnRef(status)); 225 .WillRepeatedly(ReturnRef(status));
216 EXPECT_CALL(*mock_screen_observer_, 226 EXPECT_CALL(*mock_screen_observer_,
217 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING)) 227 OnExit(ScreenObserver::UPDATE_ERROR_UPDATING))
218 .Times(1); 228 .Times(1);
219 update_screen_->UpdateStatusChanged(mock_update_library_); 229 update_screen_->UpdateStatusChanged(mock_update_library_);
220 } 230 }
221 231
222 } // namespace chromeos 232 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698