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 <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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // This is disabled twice: once right after signin but before checking for | 235 // This is disabled twice: once right after signin but before checking for |
236 // auto-enrollment, and again after doing an ownership status check. | 236 // auto-enrollment, and again after doing an ownership status check. |
237 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) | 237 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) |
238 .Times(2); | 238 .Times(2); |
239 UserContext user_context(kUsername); | 239 UserContext user_context(kUsername); |
240 user_context.SetKey(Key(kPassword)); | 240 user_context.SetKey(Key(kPassword)); |
241 user_context.SetUserIDHash(kUsername); | 241 user_context.SetUserIDHash(kUsername); |
242 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) | 242 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) |
243 .Times(1) | 243 .Times(1) |
244 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); | 244 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); |
245 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _)) | 245 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _)) |
246 .Times(1) | 246 .Times(1) |
247 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, | 247 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, |
248 &base::Callback<void(void)>::Run)); | 248 &base::Callback<void(void)>::Run)); |
249 EXPECT_CALL(*mock_login_utils_, | 249 EXPECT_CALL(*mock_login_utils_, |
250 DoBrowserLaunch(testing_profile_.get(), | 250 DoBrowserLaunch(testing_profile_.get(), |
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_, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 UserContext user_context(kNewUsername); | 301 UserContext user_context(kNewUsername); |
302 user_context.SetKey(Key(kPassword)); | 302 user_context.SetKey(Key(kPassword)); |
303 user_context.SetUserIDHash(kNewUsername); | 303 user_context.SetUserIDHash(kNewUsername); |
304 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) | 304 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) |
305 .Times(1) | 305 .Times(1) |
306 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); | 306 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); |
307 base::Callback<void(void)> add_user_cb = | 307 base::Callback<void(void)> add_user_cb = |
308 base::Bind(&MockUserManager::AddUser, | 308 base::Bind(&MockUserManager::AddUser, |
309 base::Unretained(mock_user_manager_), | 309 base::Unretained(mock_user_manager_), |
310 kNewUsername); | 310 kNewUsername); |
311 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _)) | 311 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _)) |
312 .Times(1) | 312 .Times(1) |
313 .WillOnce(DoAll( | 313 .WillOnce(DoAll( |
314 InvokeWithoutArgs(&add_user_cb, | 314 InvokeWithoutArgs(&add_user_cb, |
315 &base::Callback<void(void)>::Run), | 315 &base::Callback<void(void)>::Run), |
316 InvokeWithoutArgs(&profile_prepared_cb_, | 316 InvokeWithoutArgs(&profile_prepared_cb_, |
317 &base::Callback<void(void)>::Run))); | 317 &base::Callback<void(void)>::Run))); |
318 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin()) | 318 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin()) |
319 .Times(1); | 319 .Times(1); |
320 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew()) | 320 EXPECT_CALL(*mock_user_manager_, IsCurrentUserNew()) |
321 .Times(AnyNumber()) | 321 .Times(AnyNumber()) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 425 |
426 virtual void SetUpUserManager() OVERRIDE { | 426 virtual void SetUpUserManager() OVERRIDE { |
427 } | 427 } |
428 | 428 |
429 void ExpectSuccessfulLogin(const UserContext& user_context) { | 429 void ExpectSuccessfulLogin(const UserContext& user_context) { |
430 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) | 430 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) |
431 .Times(AnyNumber()); | 431 .Times(AnyNumber()); |
432 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) | 432 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) |
433 .Times(1) | 433 .Times(1) |
434 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); | 434 .WillOnce(WithArg<0>(CreateAuthenticator(user_context))); |
435 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _)) | 435 EXPECT_CALL(*mock_login_utils_, PrepareProfile(user_context, _, _, _, _)) |
436 .Times(1) | 436 .Times(1) |
437 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, | 437 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, |
438 &base::Callback<void(void)>::Run)); | 438 &base::Callback<void(void)>::Run)); |
439 EXPECT_CALL(*mock_login_utils_, | 439 EXPECT_CALL(*mock_login_utils_, |
440 DoBrowserLaunch(testing_profile_.get(), | 440 DoBrowserLaunch(testing_profile_.get(), |
441 mock_login_display_host_.get())) | 441 mock_login_display_host_.get())) |
442 .Times(1); | 442 .Times(1); |
443 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) | 443 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) |
444 .Times(1); | 444 .Times(1); |
445 EXPECT_CALL(*mock_login_display_host_, | 445 EXPECT_CALL(*mock_login_display_host_, |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |