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

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

Issue 290483003: Tame the proliferation of UserContext constructors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 MockConsumer mock_consumer; 499 MockConsumer mock_consumer;
500 500
501 // Must have a pending signin to resume after auto-enrollment: 501 // Must have a pending signin to resume after auto-enrollment:
502 LoginDisplayHostImpl::default_host()->StartSignInScreen(LoginScreenContext()); 502 LoginDisplayHostImpl::default_host()->StartSignInScreen(LoginScreenContext());
503 EXPECT_FALSE(ExistingUserController::current_controller() == NULL); 503 EXPECT_FALSE(ExistingUserController::current_controller() == NULL);
504 ExistingUserController::current_controller()->DoAutoEnrollment(); 504 ExistingUserController::current_controller()->DoAutoEnrollment();
505 ExistingUserController::current_controller()->set_login_status_consumer( 505 ExistingUserController::current_controller()->set_login_status_consumer(
506 &mock_consumer); 506 &mock_consumer);
507 // This calls StartWizard, destroying the current controller() and its mocks; 507 // This calls StartWizard, destroying the current controller() and its mocks;
508 // don't set expectations on those objects. 508 // don't set expectations on those objects.
509 ExistingUserController::current_controller()->CompleteLogin( 509 UserContext user_context(kUsername);
510 UserContext(kUsername, kPassword, "")); 510 user_context.SetPassword(kPassword);
511 ExistingUserController::current_controller()->CompleteLogin(user_context);
511 // Run the tasks posted to complete the login: 512 // Run the tasks posted to complete the login:
512 base::MessageLoop::current()->RunUntilIdle(); 513 base::MessageLoop::current()->RunUntilIdle();
513 514
514 EnrollmentScreen* screen = 515 EnrollmentScreen* screen =
515 WizardController::default_controller()->GetEnrollmentScreen(); 516 WizardController::default_controller()->GetEnrollmentScreen();
516 EXPECT_EQ(screen, WizardController::default_controller()->current_screen()); 517 EXPECT_EQ(screen, WizardController::default_controller()->current_screen());
517 // This is the main expectation: after auto-enrollment, login is resumed. 518 // This is the main expectation: after auto-enrollment, login is resumed.
518 EXPECT_CALL(mock_consumer, OnLoginSuccess(_)).Times(1); 519 EXPECT_CALL(mock_consumer, OnLoginSuccess(_)).Times(1);
519 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED); 520 OnExit(ScreenObserver::ENTERPRISE_AUTO_MAGIC_ENROLLMENT_COMPLETED);
520 // Prevent browser launch when the profile is prepared: 521 // Prevent browser launch when the profile is prepared:
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 843
843 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571 844 // TODO(nkostylev): Add test for WebUI accelerators http://crosbug.com/22571
844 845
845 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when 846 // TODO(merkulova): Add tests for bluetooth HID detection screen variations when
846 // UI and logic is ready. http://crbug.com/127016 847 // UI and logic is ready. http://crbug.com/127016
847 848
848 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 21, 849 COMPILE_ASSERT(ScreenObserver::EXIT_CODES_COUNT == 21,
849 add_tests_for_new_control_flow_you_just_introduced); 850 add_tests_for_new_control_flow_you_just_introduced);
850 851
851 } // namespace chromeos 852 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698