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

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

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 7 years, 11 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/bind.h" 5 #include "base/bind.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/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" 9 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
10 #include "chrome/browser/chromeos/cros/cros_mock.h" 10 #include "chrome/browser/chromeos/cros/cros_mock.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, ExistingUserLogin) { 246 IN_PROC_BROWSER_TEST_F(ExistingUserControllerTest, ExistingUserLogin) {
247 // This is disabled twice: once right after signin but before checking for 247 // This is disabled twice: once right after signin but before checking for
248 // auto-enrollment, and again after doing an ownership status check. 248 // auto-enrollment, and again after doing an ownership status check.
249 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false)) 249 EXPECT_CALL(*mock_login_display_, SetUIEnabled(false))
250 .Times(2); 250 .Times(2);
251 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) 251 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
252 .Times(1) 252 .Times(1)
253 .WillOnce(WithArg<0>(Invoke(CreateAuthenticator))); 253 .WillOnce(WithArg<0>(Invoke(CreateAuthenticator)));
254 EXPECT_CALL(*mock_login_utils_, 254 EXPECT_CALL(*mock_login_utils_,
255 PrepareProfile(kUsername, _, kPassword, false, _, _, _)) 255 PrepareProfile(kUsername, _, kPassword, _, _, _))
256 .Times(1) 256 .Times(1)
257 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, 257 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
258 &base::Callback<void(void)>::Run)); 258 &base::Callback<void(void)>::Run));
259 EXPECT_CALL(*mock_login_utils_, 259 EXPECT_CALL(*mock_login_utils_,
260 DoBrowserLaunch(testing_profile_.get(), 260 DoBrowserLaunch(testing_profile_.get(),
261 mock_login_display_host_.get())) 261 mock_login_display_host_.get()))
262 .Times(1); 262 .Times(1);
263 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kUsername)) 263 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kUsername))
264 .Times(1); 264 .Times(1);
265 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) 265 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true))
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // activated. In a real WizardController instance that is immediately switched 310 // activated. In a real WizardController instance that is immediately switched
311 // to image screen but this tests uses MockLoginDisplayHost instead. 311 // to image screen but this tests uses MockLoginDisplayHost instead.
312 EXPECT_CALL(*mock_login_display_host_, 312 EXPECT_CALL(*mock_login_display_host_,
313 StartWizard(AnyOf(WizardController::kRegistrationScreenName, 313 StartWizard(AnyOf(WizardController::kRegistrationScreenName,
314 WizardController::kUserImageScreenName), _)) 314 WizardController::kUserImageScreenName), _))
315 .Times(1); 315 .Times(1);
316 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_)) 316 EXPECT_CALL(*mock_login_utils_, CreateAuthenticator(_))
317 .Times(1) 317 .Times(1)
318 .WillOnce(WithArg<0>(Invoke(CreateAuthenticatorNewUser))); 318 .WillOnce(WithArg<0>(Invoke(CreateAuthenticatorNewUser)));
319 EXPECT_CALL(*mock_login_utils_, 319 EXPECT_CALL(*mock_login_utils_,
320 PrepareProfile(kNewUsername, _, kPassword, false, _, _, _)) 320 PrepareProfile(kNewUsername, _, kPassword, _, _, _))
321 .Times(1) 321 .Times(1)
322 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_, 322 .WillOnce(InvokeWithoutArgs(&profile_prepared_cb_,
323 &base::Callback<void(void)>::Run)); 323 &base::Callback<void(void)>::Run));
324 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kNewUsername)) 324 EXPECT_CALL(*mock_login_display_, OnLoginSuccess(kNewUsername))
325 .Times(1); 325 .Times(1);
326 EXPECT_CALL(*mock_login_display_, OnFadeOut()) 326 EXPECT_CALL(*mock_login_display_, OnFadeOut())
327 .Times(1); 327 .Times(1);
328 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin()) 328 EXPECT_CALL(*mock_login_display_host_.get(), OnCompleteLogin())
329 .Times(1); 329 .Times(1);
330 EXPECT_CALL(*mock_user_manager_.user_manager(), IsCurrentUserNew()) 330 EXPECT_CALL(*mock_user_manager_.user_manager(), IsCurrentUserNew())
(...skipping 10 matching lines...) Expand all
341 .InSequence(uiEnabledSequence); 341 .InSequence(uiEnabledSequence);
342 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true)) 342 EXPECT_CALL(*mock_login_display_, SetUIEnabled(true))
343 .Times(1) 343 .Times(1)
344 .InSequence(uiEnabledSequence); 344 .InSequence(uiEnabledSequence);
345 345
346 existing_user_controller()->CompleteLogin(kNewUsername, kPassword); 346 existing_user_controller()->CompleteLogin(kNewUsername, kPassword);
347 content::RunAllPendingInMessageLoop(); 347 content::RunAllPendingInMessageLoop();
348 } 348 }
349 349
350 } // namespace chromeos 350 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698