| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/password_manager/content/browser/credential_manager_impl.h" | 5 #include "components/password_manager/content/browser/credential_manager_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 _, CredentialSourceType::CREDENTIAL_SOURCE_API)) | 685 _, CredentialSourceType::CREDENTIAL_SOURCE_API)) |
| 686 .Times(testing::Exactly(0)); | 686 .Times(testing::Exactly(0)); |
| 687 EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) | 687 EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) |
| 688 .Times(testing::Exactly(0)); | 688 .Times(testing::Exactly(0)); |
| 689 EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); | 689 EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); |
| 690 | 690 |
| 691 ExpectCredentialType(false, true, federations, mojom::CredentialType::EMPTY); | 691 ExpectCredentialType(false, true, federations, mojom::CredentialType::EMPTY); |
| 692 } | 692 } |
| 693 | 693 |
| 694 TEST_F(CredentialManagerImplTest, | 694 TEST_F(CredentialManagerImplTest, |
| 695 CredentialManagerOnRequestCredentialWithEmptyUsernames) { |
| 696 form_.username_value.clear(); |
| 697 store_->AddLogin(form_); |
| 698 EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) |
| 699 .Times(testing::Exactly(0)); |
| 700 EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); |
| 701 |
| 702 std::vector<GURL> federations; |
| 703 ExpectCredentialType(false, true, federations, mojom::CredentialType::EMPTY); |
| 704 } |
| 705 |
| 706 TEST_F(CredentialManagerImplTest, |
| 707 CredentialManagerOnRequestCredentialWithEmptyAndNonUsernames) { |
| 708 store_->AddLogin(form_); |
| 709 autofill::PasswordForm empty = form_; |
| 710 empty.username_value.clear(); |
| 711 store_->AddLogin(empty); |
| 712 |
| 713 std::vector<GURL> federations; |
| 714 ExpectZeroClickSignInSuccess(false, true, federations, |
| 715 mojom::CredentialType::PASSWORD); |
| 716 } |
| 717 |
| 718 TEST_F(CredentialManagerImplTest, |
| 695 CredentialManagerOnRequestCredentialWithCrossOriginPasswordStore) { | 719 CredentialManagerOnRequestCredentialWithCrossOriginPasswordStore) { |
| 696 store_->AddLogin(cross_origin_form_); | 720 store_->AddLogin(cross_origin_form_); |
| 697 | 721 |
| 698 std::vector<GURL> federations; | 722 std::vector<GURL> federations; |
| 699 EXPECT_CALL(*client_, PromptUserToSavePasswordPtr( | 723 EXPECT_CALL(*client_, PromptUserToSavePasswordPtr( |
| 700 _, CredentialSourceType::CREDENTIAL_SOURCE_API)) | 724 _, CredentialSourceType::CREDENTIAL_SOURCE_API)) |
| 701 .Times(testing::Exactly(0)); | 725 .Times(testing::Exactly(0)); |
| 702 EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) | 726 EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(_, _, _, _)) |
| 703 .Times(testing::Exactly(0)); | 727 .Times(testing::Exactly(0)); |
| 704 EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); | 728 EXPECT_CALL(*client_, NotifyUserAutoSigninPtr(_)).Times(testing::Exactly(0)); |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 _, CredentialSourceType::CREDENTIAL_SOURCE_API)); | 1324 _, CredentialSourceType::CREDENTIAL_SOURCE_API)); |
| 1301 CallStore(info, base::Bind(&RespondCallback, &called)); | 1325 CallStore(info, base::Bind(&RespondCallback, &called)); |
| 1302 // Allow the PasswordFormManager to talk to the password store | 1326 // Allow the PasswordFormManager to talk to the password store |
| 1303 RunAllPendingTasks(); | 1327 RunAllPendingTasks(); |
| 1304 | 1328 |
| 1305 ASSERT_TRUE(client_->pending_manager()); | 1329 ASSERT_TRUE(client_->pending_manager()); |
| 1306 EXPECT_TRUE(client_->pending_manager()->IsBlacklisted()); | 1330 EXPECT_TRUE(client_->pending_manager()->IsBlacklisted()); |
| 1307 } | 1331 } |
| 1308 | 1332 |
| 1309 } // namespace password_manager | 1333 } // namespace password_manager |
| OLD | NEW |