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

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: iOS HTTP Bad. 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
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b4e50ea1ef4dc1e105b5f973b006db92c77c7d6d..4f6fd359fc76fc97f930f4601647e7495affcd90 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -758,6 +758,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;
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web/web_state/web_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698