OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 LoginFailure failure = LoginFailure::FromNetworkAuthFailure(error); | 563 LoginFailure failure = LoginFailure::FromNetworkAuthFailure(error); |
564 state_.release()->PresetOnlineLoginStatus(result_, failure); | 564 state_.release()->PresetOnlineLoginStatus(result_, failure); |
565 ExpectLoginFailure(failure); | 565 ExpectLoginFailure(failure); |
566 | 566 |
567 RunResolve(auth_.get(), &message_loop_); | 567 RunResolve(auth_.get(), &message_loop_); |
568 | 568 |
569 // After the request below completes, OnLoginSuccess gets called again. | 569 // After the request below completes, OnLoginSuccess gets called again. |
570 ExpectLoginSuccess(username_, password_, result_, false); | 570 ExpectLoginSuccess(username_, password_, result_, false); |
571 | 571 |
572 MockFactory<SuccessFetcher> factory; | 572 MockFactory<SuccessFetcher> factory; |
573 URLFetcher::set_factory(&factory); | |
574 TestingProfile profile; | 573 TestingProfile profile; |
575 | 574 |
576 auth_->RetryAuth(&profile, | 575 auth_->RetryAuth(&profile, |
577 username_, | 576 username_, |
578 std::string(), | 577 std::string(), |
579 std::string(), | 578 std::string(), |
580 std::string()); | 579 std::string()); |
581 message_loop_.Run(); | 580 message_loop_.Run(); |
582 } | 581 } |
583 | 582 |
(...skipping 22 matching lines...) Expand all Loading... |
606 | 605 |
607 // After the request below completes, OnLoginSuccess gets called again. | 606 // After the request below completes, OnLoginSuccess gets called again. |
608 failure = LoginFailure::FromNetworkAuthFailure( | 607 failure = LoginFailure::FromNetworkAuthFailure( |
609 GoogleServiceAuthError::FromCaptchaChallenge( | 608 GoogleServiceAuthError::FromCaptchaChallenge( |
610 CaptchaFetcher::GetCaptchaToken(), | 609 CaptchaFetcher::GetCaptchaToken(), |
611 GURL(CaptchaFetcher::GetCaptchaUrl()), | 610 GURL(CaptchaFetcher::GetCaptchaUrl()), |
612 GURL(CaptchaFetcher::GetUnlockUrl()))); | 611 GURL(CaptchaFetcher::GetUnlockUrl()))); |
613 ExpectLoginFailure(failure); | 612 ExpectLoginFailure(failure); |
614 | 613 |
615 MockFactory<CaptchaFetcher> factory; | 614 MockFactory<CaptchaFetcher> factory; |
616 URLFetcher::set_factory(&factory); | |
617 TestingProfile profile; | 615 TestingProfile profile; |
618 | 616 |
619 auth_->RetryAuth(&profile, | 617 auth_->RetryAuth(&profile, |
620 username_, | 618 username_, |
621 std::string(), | 619 std::string(), |
622 std::string(), | 620 std::string(), |
623 std::string()); | 621 std::string()); |
624 message_loop_.Run(); | 622 message_loop_.Run(); |
625 } | 623 } |
626 | 624 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 FilePath tmp_file_path = FakeLocalaccountFile(username_); | 722 FilePath tmp_file_path = FakeLocalaccountFile(username_); |
725 ReadLocalaccountFile(auth_.get(), tmp_file_path.BaseName().value()); | 723 ReadLocalaccountFile(auth_.get(), tmp_file_path.BaseName().value()); |
726 | 724 |
727 auth_->AuthenticateToUnlock(username_, ""); | 725 auth_->AuthenticateToUnlock(username_, ""); |
728 message_loop_.Run(); | 726 message_loop_.Run(); |
729 | 727 |
730 Delete(tmp_file_path, false); | 728 Delete(tmp_file_path, false); |
731 } | 729 } |
732 | 730 |
733 } // namespace chromeos | 731 } // namespace chromeos |
OLD | NEW |