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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/browser_shutdown.h" | 7 #include "chrome/browser/browser_shutdown.h" |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
9 #include "chrome/browser/chromeos/cros/network_library.h" | 9 #include "chrome/browser/chromeos/cros/network_library.h" |
10 #include "chrome/browser/chromeos/login/base_login_display_host.h" | 10 #include "chrome/browser/chromeos/login/base_login_display_host.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 MockConsumer mock_consumer; | 286 MockConsumer mock_consumer; |
287 | 287 |
288 // Must have a pending signin to resume after auto-enrollment: | 288 // Must have a pending signin to resume after auto-enrollment: |
289 BaseLoginDisplayHost::default_host()->StartSignInScreen(); | 289 BaseLoginDisplayHost::default_host()->StartSignInScreen(); |
290 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); | 290 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); |
291 ExistingUserController::current_controller()->DoAutoEnrollment(); | 291 ExistingUserController::current_controller()->DoAutoEnrollment(); |
292 ExistingUserController::current_controller()->set_login_status_consumer( | 292 ExistingUserController::current_controller()->set_login_status_consumer( |
293 &mock_consumer); | 293 &mock_consumer); |
294 // This calls StartWizard, destroying the current controller() and its mocks; | 294 // This calls StartWizard, destroying the current controller() and its mocks; |
295 // don't set expectations on those objects. | 295 // don't set expectations on those objects. |
296 ExistingUserController::current_controller()->CompleteLogin(kUsername, | 296 ExistingUserController::current_controller()->CompleteLogin( |
297 kPassword); | 297 UserCredentials(kUsername, kPassword, "")); |
298 // Run the tasks posted to complete the login: | 298 // Run the tasks posted to complete the login: |
299 MessageLoop::current()->RunUntilIdle(); | 299 MessageLoop::current()->RunUntilIdle(); |
300 | 300 |
301 EnterpriseEnrollmentScreen* screen = | 301 EnterpriseEnrollmentScreen* screen = |
302 WizardController::default_controller()->GetEnterpriseEnrollmentScreen(); | 302 WizardController::default_controller()->GetEnterpriseEnrollmentScreen(); |
303 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); | 303 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); |
304 // This is the main expectation: after auto-enrollment, login is resumed. | 304 // This is the main expectation: after auto-enrollment, login is resumed. |
305 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _, _)).Times(1); | 305 EXPECT_CALL(mock_consumer, OnLoginSuccess(_, _, _)).Times(1); |
306 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); | 306 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); |
307 // Prevent browser launch when the profile is prepared: | 307 // Prevent browser launch when the profile is prepared: |
308 browser_shutdown::SetTryingToQuit(true); | 308 browser_shutdown::SetTryingToQuit(true); |
309 // Run the tasks posted to complete the login: | 309 // Run the tasks posted to complete the login: |
310 MessageLoop::current()->RunUntilIdle(); | 310 MessageLoop::current()->RunUntilIdle(); |
311 } | 311 } |
312 | 312 |
313 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { | 313 IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { |
314 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), | 314 EXPECT_EQ(WizardController::default_controller()->GetNetworkScreen(), |
315 WizardController::default_controller()->current_screen()); | 315 WizardController::default_controller()->current_screen()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 | 349 |
350 // TODO(dzhioev): Add test emaulating device with wrong HWID. | 350 // TODO(dzhioev): Add test emaulating device with wrong HWID. |
351 | 351 |
352 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 | 352 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 |
353 | 353 |
354 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, | 354 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 15, |
355 add_tests_for_new_control_flow_you_just_introduced); | 355 add_tests_for_new_control_flow_you_just_introduced); |
356 | 356 |
357 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |