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

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

Issue 12704002: Support for auth code based authentication flow for both app and web UI driven flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase4 Created 7 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 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/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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_screen_locker.cc ('k') | chrome/browser/resources/chromeos/login/screen_gaia_signin.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698