Index: components/password_manager/core/browser/password_manager_unittest.cc |
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc |
index 5266521fa165fd61e8266494203c3c37e63ad2a9..94a666630d5539ca070187298e45f549a7790f4b 100644 |
--- a/components/password_manager/core/browser/password_manager_unittest.cc |
+++ b/components/password_manager/core/browser/password_manager_unittest.cc |
@@ -737,16 +737,43 @@ TEST_F(PasswordManagerTest, AutofillingNotEnabledOnSSLErrors) { |
manager()->OnPasswordFormsParsed(&driver_, forms); |
} |
-TEST_F(PasswordManagerTest, SavingDisabledIfManagerDisabled) { |
+TEST_F(PasswordManagerTest, SavingDisabledIfManagerDisabledWithSSLErrors) { |
vabr (Chromium)
2015/03/30 10:58:43
Two more kinds of tests for both saving and autofi
|
EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) |
.WillRepeatedly(Return(false)); |
+ EXPECT_CALL(client_, DidLastPageLoadEncounterSSLErrors()) |
+ .WillRepeatedly(Return(true)); |
EXPECT_FALSE(manager()->IsSavingEnabledForCurrentPage()); |
} |
-TEST_F(PasswordManagerTest, AutofillingDisabledIfManagerDisabled) { |
+TEST_F(PasswordManagerTest, SavingDisabledIfManagerDisabledWithoutSSLErros) { |
EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) |
.WillRepeatedly(Return(false)); |
+ EXPECT_CALL(client_, DidLastPageLoadEncounterSSLErrors()) |
+ .WillRepeatedly(Return(false)); |
+ EXPECT_FALSE(manager()->IsSavingEnabledForCurrentPage()); |
+} |
+TEST_F(PasswordManagerTest, AutofillingDisabledIfManagerDisabledWithSSLErrors) { |
+ EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) |
+ .WillRepeatedly(Return(false)); |
+ EXPECT_CALL(client_, DidLastPageLoadEncounterSSLErrors()) |
+ .WillRepeatedly(Return(true)); |
+ // Let us pretend some forms were found on a website. |
+ std::vector<PasswordForm> forms; |
+ forms.push_back(MakeSimpleForm()); |
+ |
+ // Feed those forms to |manager()| and check that it does not try to find |
+ // matching saved credentials for the forms. |
+ EXPECT_CALL(*store_, GetLogins(_, _, _)).Times(Exactly(0)); |
+ manager()->OnPasswordFormsParsed(&driver_, forms); |
+} |
+ |
+TEST_F(PasswordManagerTest, |
+ AutofillingDisabledIfManagerDisabledWithoutSSLErrors) { |
+ EXPECT_CALL(client_, IsPasswordManagerEnabledForCurrentPage()) |
+ .WillRepeatedly(Return(false)); |
+ EXPECT_CALL(client_, DidLastPageLoadEncounterSSLErrors()) |
+ .WillRepeatedly(Return(false)); |
// Let us pretend some forms were found on a website. |
std::vector<PasswordForm> forms; |
forms.push_back(MakeSimpleForm()); |