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

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

Issue 2669123003: iOS: Mark HTTP pages with credit card fields with an omnibox icon. (Closed)
Patch Set: Add CRWWebController test. Created 3 years, 11 months 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 2189963af91336b9e2aa549394df06ecc601556f..c55f2ea3012ad8fd99d72ea7bbbb08fd23c484cd 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -702,6 +702,19 @@ TEST_F(CRWWebControllerNavigationTest, HTTPPassword) {
web::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP);
}
+// Tests that didShowCreditCardInputOnHTTP updates the SSLStatus to indicate
+// that a credit card field has been displayed on an HTTP page.
+TEST_F(CRWWebControllerNavigationTest, HTTPCreditCard) {
+ 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_CREDIT_CARD_FIELD_ON_HTTP);
+ [web_controller() didShowCreditCardInputOnHTTP];
+ EXPECT_TRUE(nav_manager.GetLastCommittedItem()->GetSSL().content_status &
+ web::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP);
+}
+
// Real WKWebView is required for CRWWebControllerFormActivityTest.
typedef web::WebTestWithWebController CRWWebControllerFormActivityTest;

Powered by Google App Engine
This is Rietveld 408576698