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

Unified Diff: ios/web/web_state/ui/crw_web_controller_unittest.mm

Issue 2466143002: iOS: Mark HTTP pages with password fields with an omnibox icon. (Closed)
Patch Set: 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: ios/web/web_state/ui/crw_web_controller_unittest.mm
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index 5ed3e78ddbde8a0fba290eee8fd8f9f039e681d7..feca879941511c09fe93a334e041ee9e7b8db788 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -769,6 +769,19 @@ TEST_F(CRWWebControllerNavigationTest, GoToEntryWithoutDocumentChange) {
session_controller.currentEntry);
}
+// Tests that didShowPasswordInputOnHTTP updates the SSLStatus to indicate that
+// a password field has been displayed on an HTTP page.
+TEST_F(CRWWebControllerNavigationTest, HTTPPassword) {
+ LoadHtml(@"<html><body></body></html>", GURL("http://chromium.test"));
+ NavigationManagerImpl& nav_manager =
+ web_controller().webStateImpl->GetNavigationManagerImpl();
+ EXPECT_FALSE(nav_manager.GetLastCommittedItem()->GetSSL().content_status &
+ web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP);
+ [web_controller() didShowPasswordInputOnHTTP];
+ EXPECT_TRUE(nav_manager.GetLastCommittedItem()->GetSSL().content_status &
+ web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP);
+}
+
// Real WKWebView is required for CRWWebControllerJSExecutionTest.
typedef web::WebTestWithWebController CRWWebControllerJSExecutionTest;

Powered by Google App Engine
This is Rietveld 408576698