| OLD | NEW |
| 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/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/browser_shutdown.h" | 9 #include "chrome/browser/browser_shutdown.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 LoginDisplayHostImpl::default_host()->StartSignInScreen(); | 300 LoginDisplayHostImpl::default_host()->StartSignInScreen(); |
| 301 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); | 301 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); |
| 302 ExistingUserController::current_controller()->DoAutoEnrollment(); | 302 ExistingUserController::current_controller()->DoAutoEnrollment(); |
| 303 ExistingUserController::current_controller()->set_login_status_consumer( | 303 ExistingUserController::current_controller()->set_login_status_consumer( |
| 304 &mock_consumer); | 304 &mock_consumer); |
| 305 // This calls StartWizard, destroying the current controller() and its mocks; | 305 // This calls StartWizard, destroying the current controller() and its mocks; |
| 306 // don't set expectations on those objects. | 306 // don't set expectations on those objects. |
| 307 ExistingUserController::current_controller()->CompleteLogin( | 307 ExistingUserController::current_controller()->CompleteLogin( |
| 308 UserContext(kUsername, kPassword, "")); | 308 UserContext(kUsername, kPassword, "")); |
| 309 // Run the tasks posted to complete the login: | 309 // Run the tasks posted to complete the login: |
| 310 MessageLoop::current()->RunUntilIdle(); | 310 base::MessageLoop::current()->RunUntilIdle(); |
| 311 | 311 |
| 312 EnrollmentScreen* screen = | 312 EnrollmentScreen* screen = |
| 313 WizardController::default_controller()->GetEnrollmentScreen(); | 313 WizardController::default_controller()->GetEnrollmentScreen(); |
| 314 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); | 314 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); |
| 315 // This is the main expectation: after auto-enrollment, login is resumed. | 315 // This is the main expectation: after auto-enrollment, login is resumed. |
| 316 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _)).Times(1); | 316 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _)).Times(1); |
| 317 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); | 317 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); |
| 318 // Prevent browser launch when the profile is prepared: | 318 // Prevent browser launch when the profile is prepared: |
| 319 browser_shutdown::SetTryingToQuit(true); | 319 browser_shutdown::SetTryingToQuit(true); |
| 320 // Run the tasks posted to complete the login: | 320 // Run the tasks posted to complete the login: |
| 321 MessageLoop::current()->RunUntilIdle(); | 321 base::MessageLoop::current()->RunUntilIdle(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { | 324 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { |
| 325 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), | 325 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), |
| 326 WizardController::default_controller()->current_screen()); | 326 WizardController::default_controller()->current_screen()); |
| 327 | 327 |
| 328 LoginDisplayHostImpl::default_host()->StartSignInScreen(); | 328 LoginDisplayHostImpl::default_host()->StartSignInScreen(); |
| 329 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); | 329 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); |
| 330 ExistingUserController::current_controller()->OnStartDeviceReset(); | 330 ExistingUserController::current_controller()->OnStartDeviceReset(); |
| 331 | 331 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 419 } |
| 420 | 420 |
| 421 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 421 // TODO(dzhioev): Add test emaulating device with wrong HWID. |
| 422 | 422 |
| 423 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 423 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 |
| 424 | 424 |
| 425 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, | 425 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, |
| 426 add_tests_for_new_control_flow_you_just_introduced); | 426 add_tests_for_new_control_flow_you_just_introduced); |
| 427 | 427 |
| 428 } // namespace chromeos | 428 } // namespace chromeos |
| OLD | NEW |