| Index: components/password_manager/content/browser/credential_manager_impl_unittest.cc
|
| diff --git a/components/password_manager/content/browser/credential_manager_impl_unittest.cc b/components/password_manager/content/browser/credential_manager_impl_unittest.cc
|
| index b9c6ef38f16e39c029f8a53a20243c6851e4512b..a3b064cd34cd5e0b9db83ef0d00972561a1d4ace 100644
|
| --- a/components/password_manager/content/browser/credential_manager_impl_unittest.cc
|
| +++ b/components/password_manager/content/browser/credential_manager_impl_unittest.cc
|
| @@ -56,6 +56,7 @@ class MockPasswordManagerClient : public StubPasswordManagerClient {
|
| public:
|
| MOCK_CONST_METHOD0(IsSavingAndFillingEnabledForCurrentPage, bool());
|
| MOCK_CONST_METHOD0(IsFillingEnabledForCurrentPage, bool());
|
| + MOCK_METHOD0(OnCredentialManagerUsed, bool());
|
| MOCK_CONST_METHOD0(IsOffTheRecord, bool());
|
| MOCK_METHOD0(NotifyUserAutoSigninPtr, bool());
|
| MOCK_METHOD1(NotifyUserCouldBeAutoSignedInPtr,
|
| @@ -215,6 +216,8 @@ class CredentialManagerImplTest : public content::RenderViewHostTestHarness {
|
| .WillByDefault(testing::Return(true));
|
| ON_CALL(*client_, IsFillingEnabledForCurrentPage())
|
| .WillByDefault(testing::Return(true));
|
| + ON_CALL(*client_, OnCredentialManagerUsed())
|
| + .WillByDefault(testing::Return(true));
|
| ON_CALL(*client_, IsOffTheRecord()).WillByDefault(testing::Return(false));
|
|
|
| NavigateAndCommit(GURL("https://example.com/test.html"));
|
| @@ -1037,6 +1040,18 @@ TEST_F(CredentialManagerImplTest, RequestCredentialWithTLSErrors) {
|
| ExpectZeroClickSignInFailure(true, true, federations);
|
| }
|
|
|
| +TEST_F(CredentialManagerImplTest, RequestCredentialWhilePrerendering) {
|
| + // The client disallows the credential manager for the current page.
|
| + EXPECT_CALL(*client_, OnCredentialManagerUsed())
|
| + .WillRepeatedly(testing::Return(false));
|
| +
|
| + store_->AddLogin(form_);
|
| +
|
| + std::vector<GURL> federations;
|
| +
|
| + ExpectZeroClickSignInFailure(true, true, federations);
|
| +}
|
| +
|
| TEST_F(CredentialManagerImplTest,
|
| CredentialManagerOnRequestCredentialWithZeroClickOnlyTwoPasswordStore) {
|
| store_->AddLogin(form_);
|
|
|