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

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

Issue 324463003: ChromeOS login webui refactoring : Simplify login methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge with ToT Created 6 years, 6 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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 mock_login_display_host_.get())) 251 mock_login_display_host_.get()))
252 .Times(1); 252 .Times(1);
253 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) 253 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true))
254 .Times(1); 254 .Times(1);
255 EXPECT_CALL(*mock_login_display_host_, 255 EXPECT_CALL(*mock_login_display_host_,
256 StartWizardPtr(WizardController::kTermsOfServiceScreenName, NULL)) 256 StartWizardPtr(WizardController::kTermsOfServiceScreenName, NULL))
257 .Times(0); 257 .Times(0);
258 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew()) 258 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew())
259 .Times(AnyNumber()) 259 .Times(AnyNumber())
260 .WillRepeatedly(Return(false)); 260 .WillRepeatedly(Return(false));
261 existing_user_controller()->Login(user_context); 261 existing_user_controller()->Login(user_context, SigninSpecifics());
262 content::RunAllPendingInMessageLoop(); 262 content::RunAllPendingInMessageLoop();
263 } 263 }
264 264
265 IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, AutoEnrollAfterSignIn) { 265 IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, AutoEnrollAfterSignIn) {
266 EXPECT_CALL(*mock_login_display_host_, 266 EXPECT_CALL(*mock_login_display_host_,
267 StartWizardPtr(WizardController::kEnrollmentScreenName, 267 StartWizardPtr(WizardController::kEnrollmentScreenName,
268 _)) 268 _))
269 .Times(1); 269 .Times(1);
270 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin()) 270 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin())
271 .Times(1); 271 .Times(1);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 UserContext user_context(kUsername); 570 UserContext user_context(kUsername);
571 user_context.SetKey(Key(kPassword)); 571 user_context.SetKey(Key(kPassword));
572 user_context.SetUserIDHash(user_context.GetUserID()); 572 user_context.SetUserIDHash(user_context.GetUserID());
573 ExpectSuccessfulLogin(user_context); 573 ExpectSuccessfulLogin(user_context);
574 574
575 existing_user_controller()->OnSigninScreenReady(); 575 existing_user_controller()->OnSigninScreenReady();
576 SetAutoLoginPolicy(kPublicSessionAccountId, kAutoLoginLongDelay); 576 SetAutoLoginPolicy(kPublicSessionAccountId, kAutoLoginLongDelay);
577 ASSERT_TRUE(auto_login_timer()); 577 ASSERT_TRUE(auto_login_timer());
578 578
579 // Log in and check that it stopped the timer. 579 // Log in and check that it stopped the timer.
580 existing_user_controller()->Login(user_context); 580 existing_user_controller()->Login(user_context, SigninSpecifics());
581 EXPECT_TRUE(is_login_in_progress()); 581 EXPECT_TRUE(is_login_in_progress());
582 ASSERT_TRUE(auto_login_timer()); 582 ASSERT_TRUE(auto_login_timer());
583 EXPECT_FALSE(auto_login_timer()->IsRunning()); 583 EXPECT_FALSE(auto_login_timer()->IsRunning());
584 584
585 // Wait for login tasks to complete. 585 // Wait for login tasks to complete.
586 content::RunAllPendingInMessageLoop(); 586 content::RunAllPendingInMessageLoop();
587 587
588 // Timer should still be stopped after login completes. 588 // Timer should still be stopped after login completes.
589 ASSERT_TRUE(auto_login_timer()); 589 ASSERT_TRUE(auto_login_timer());
590 EXPECT_FALSE(auto_login_timer()->IsRunning()); 590 EXPECT_FALSE(auto_login_timer()->IsRunning());
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 PRE_TestLoadingPublicUsersFromLocalState) { 675 PRE_TestLoadingPublicUsersFromLocalState) {
676 // First run propagates public accounts and stores them in Local State. 676 // First run propagates public accounts and stores them in Local State.
677 } 677 }
678 678
679 IN_PROC_BROWSER_TEST_F(ExistingUserControllerPublicSessionTest, 679 IN_PROC_BROWSER_TEST_F(ExistingUserControllerPublicSessionTest,
680 TestLoadingPublicUsersFromLocalState) { 680 TestLoadingPublicUsersFromLocalState) {
681 // Second run loads list of public accounts from Local State. 681 // Second run loads list of public accounts from Local State.
682 } 682 }
683 683
684 } // namespace chromeos 684 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.cc ('k') | chrome/browser/chromeos/login/lock/webui_screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698