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

Unified Diff: components/password_manager/core/browser/password_autofill_manager_unittest.cc

Issue 2505533002: Http Bad: Add "Learn more" sublabel to warning message and make it clickable (Closed)
Patch Set: rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/password_autofill_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager_unittest.cc b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
index 1798226a8e87065aefa630eefbf94a18043e1115..c63d781e6749363c5a3bcd753915d0607ec99462 100644
--- a/components/password_manager/core/browser/password_autofill_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
@@ -71,6 +71,7 @@ class MockAutofillClient : public autofill::TestAutofillClient {
const std::vector<Suggestion>& suggestions,
base::WeakPtr<autofill::AutofillPopupDelegate> delegate));
MOCK_METHOD0(HideAutofillPopup, void());
+ MOCK_METHOD0(ShowHttpNotSecureExplanation, void());
};
} // namespace
@@ -628,6 +629,14 @@ TEST_F(PasswordAutofillManagerTest, NonSecurePasswordFieldHttpWarningMessage) {
password_autofill_manager_->OnShowPasswordSuggestions(
dummy_key, base::i18n::RIGHT_TO_LEFT, test_username_,
autofill::IS_PASSWORD_FIELD, element_bounds);
+
+ // Accepting the warning message should trigger a call to open the url and
+ // hide the popup.
+ EXPECT_CALL(*autofill_client, ShowHttpNotSecureExplanation());
+ EXPECT_CALL(*autofill_client, HideAutofillPopup());
+ password_autofill_manager_->DidAcceptSuggestion(
+ base::string16(), autofill::POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE,
+ 0);
}
TEST_F(PasswordAutofillManagerTest, SecurePasswordFieldHttpWarningMessage) {

Powered by Google App Engine
This is Rietveld 408576698