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

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

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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) 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/browser_shutdown.h" 8 #include "chrome/browser/browser_shutdown.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/cros/network_library.h" 10 #include "chrome/browser/chromeos/cros/network_library.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 kPassword); 292 kPassword);
293 EnterpriseEnrollmentScreen* screen = 293 EnterpriseEnrollmentScreen* screen =
294 WizardController::default_controller()->GetEnterpriseEnrollmentScreen(); 294 WizardController::default_controller()->GetEnterpriseEnrollmentScreen();
295 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); 295 EXPECT_EQ(screen, WizardController::default_controller()->current_screen());
296 // This is the main expectation: after auto-enrollment, login is resumed. 296 // This is the main expectation: after auto-enrollment, login is resumed.
297 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _, _)).Times(1); 297 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _, _)).Times(1);
298 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); 298 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED);
299 // Prevent browser launch when the profile is prepared: 299 // Prevent browser launch when the profile is prepared:
300 browser_shutdown::SetTryingToQuit(true); 300 browser_shutdown::SetTryingToQuit(true);
301 // Run the tasks posted to complete the login: 301 // Run the tasks posted to complete the login:
302 MessageLoop::current()->RunAllPending(); 302 MessageLoop::current()->RunUntilIdle();
303 } 303 }
304 304
305 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { 305 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) {
306 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), 306 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(),
307 WizardController::default_controller()->current_screen()); 307 WizardController::default_controller()->current_screen());
308 308
309 BaseLoginDisplayHost::default_host()->StartSignInScreen(); 309 BaseLoginDisplayHost::default_host()->StartSignInScreen();
310 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 310 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
311 ExistingUserController::current_controller()->OnStartDeviceReset(); 311 ExistingUserController::current_controller()->OnStartDeviceReset();
312 312
313 ResetScreen* screen = 313 ResetScreen* screen =
314 WizardController::default_controller()->GetResetScreen(); 314 WizardController::default_controller()->GetResetScreen();
315 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); 315 EXPECT_EQ(screen, WizardController::default_controller()->current_screen());
316 316
317 // After reset screen is canceled, it returns to sign-in screen. 317 // After reset screen is canceled, it returns to sign-in screen.
318 // And this destroys WizardController. 318 // And this destroys WizardController.
319 OnExit(ScreenObserver::RESET_CANCELED); 319 OnExit(ScreenObserver::RESET_CANCELED);
320 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 320 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
321 } 321 }
322 322
323 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 323 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571
324 324
325 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 14, 325 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 14,
326 add_tests_for_new_control_flow_you_just_introduced); 326 add_tests_for_new_control_flow_you_just_introduced);
327 327
328 } // namespace chromeos 328 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698