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

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

Issue 15929005: [CrOS multi-profiles] Restore user sessions after crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 IN_PROC_BROWSER_TEST_P(ExistingUserControllerTest, ExistingUserLogin) { 291 IN_PROC_BROWSER_TEST_P(ExistingUserControllerTest, ExistingUserLogin) {
292 // This is disabled twice: once right after signin but before checking for 292 // This is disabled twice: once right after signin but before checking for
293 // auto-enrollment, and again after doing an ownership status check. 293 // auto-enrollment, and again after doing an ownership status check.
294 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) 294 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false))
295 .Times(2); 295 .Times(2);
296 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) 296 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
297 .Times(1) 297 .Times(1)
298 .WillOnce(WithArg<0>(CreateAuthenticator(kUsername, kPassword))); 298 .WillOnce(WithArg<0>(CreateAuthenticator(kUsername, kPassword)));
299 EXPECT_CALL(*mock_login_utils_, 299 EXPECT_CALL(*mock_login_utils_,
300 PrepareProfile(UserContext(kUsername, kPassword, "", kUsername), 300 PrepareProfile(UserContext(kUsername, kPassword, "", kUsername),
301 _, _, _, _)) 301 _, _, _, _, _))
302 .Times(1) 302 .Times(1)
303 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, 303 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
304 &base::Callback<void(void)>::Run)); 304 &base::Callback<void(void)>::Run));
305 EXPECT_CALL(*mock_login_utils_, 305 EXPECT_CALL(*mock_login_utils_,
306 DoBrowserLaunch(testing_profile_.get(), 306 DoBrowserLaunch(testing_profile_.get(),
307 mock_login_display_host_.get())) 307 mock_login_display_host_.get()))
308 .Times(1); 308 .Times(1);
309 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kUsername)) 309 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kUsername))
310 .Times(1); 310 .Times(1);
311 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) 311 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true))
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 NULL)) 360 NULL))
361 .Times(1); 361 .Times(1);
362 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) 362 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
363 .Times(1) 363 .Times(1)
364 .WillOnce(WithArg<0>(CreateAuthenticator(kNewUsername, kPassword))); 364 .WillOnce(WithArg<0>(CreateAuthenticator(kNewUsername, kPassword)));
365 EXPECT_CALL(*mock_login_utils_, 365 EXPECT_CALL(*mock_login_utils_,
366 PrepareProfile(UserContext(kNewUsername, 366 PrepareProfile(UserContext(kNewUsername,
367 kPassword, 367 kPassword,
368 std::string(), 368 std::string(),
369 kNewUsername), 369 kNewUsername),
370 _, _, _, _)) 370 _, _, _, _, _))
371 .Times(1) 371 .Times(1)
372 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, 372 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
373 &base::Callback<void(void)>::Run)); 373 &base::Callback<void(void)>::Run));
374 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kNewUsername)) 374 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kNewUsername))
375 .Times(1); 375 .Times(1);
376 EXPECT_CALL(*mock_login_display_, OnFadeOut()) 376 EXPECT_CALL(*mock_login_display_, OnFadeOut())
377 .Times(1); 377 .Times(1);
378 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin()) 378 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin())
379 .Times(1); 379 .Times(1);
380 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew()) 380 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew())
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 void ExpectSuccessfulLogin(const std::string& username, 485 void ExpectSuccessfulLogin(const std::string& username,
486 const std::string& password) { 486 const std::string& password) {
487 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) 487 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false))
488 .Times(AnyNumber()); 488 .Times(AnyNumber());
489 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) 489 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
490 .Times(1) 490 .Times(1)
491 .WillOnce(WithArg<0>(CreateAuthenticator(username, password))); 491 .WillOnce(WithArg<0>(CreateAuthenticator(username, password)));
492 EXPECT_CALL(*mock_login_utils_, 492 EXPECT_CALL(*mock_login_utils_,
493 PrepareProfile(UserContext(username, password, "", username), 493 PrepareProfile(UserContext(username, password, "", username),
494 _, _, _, _)) 494 _, _, _, _, _))
495 .Times(1) 495 .Times(1)
496 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, 496 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
497 &base::Callback<void(void)>::Run)); 497 &base::Callback<void(void)>::Run));
498 EXPECT_CALL(*mock_login_utils_, 498 EXPECT_CALL(*mock_login_utils_,
499 DoBrowserLaunch(testing_profile_.get(), 499 DoBrowserLaunch(testing_profile_.get(),
500 mock_login_display_host_.get())) 500 mock_login_display_host_.get()))
501 .Times(1); 501 .Times(1);
502 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(username)) 502 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(username))
503 .Times(1); 503 .Times(1);
504 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) 504 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true))
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 INSTANTIATE_TEST_CASE_P(ExistingUserControllerTestInstantiation, 738 INSTANTIATE_TEST_CASE_P(ExistingUserControllerTestInstantiation,
739 ExistingUserControllerTest, 739 ExistingUserControllerTest,
740 testing::Bool()); 740 testing::Bool());
741 741
742 INSTANTIATE_TEST_CASE_P(ExistingUserControllerPublicSessionTestInstantiation, 742 INSTANTIATE_TEST_CASE_P(ExistingUserControllerPublicSessionTestInstantiation,
743 ExistingUserControllerPublicSessionTest, 743 ExistingUserControllerPublicSessionTest,
744 testing::Bool()); 744 testing::Bool());
745 745
746 } // namespace chromeos 746 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.cc ('k') | chrome/browser/chromeos/login/login_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698