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

Unified Diff: components/security_state/content/content_utils_unittest.cc

Issue 2917873004: Implement 'Not secure' warning for non-secure pages in Incognito mode (Closed)
Patch Set: Remove obsolete includes Created 3 years, 6 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
« no previous file with comments | « components/security_state/content/content_utils.cc ('k') | components/security_state/core/security_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/security_state/content/content_utils_unittest.cc
diff --git a/components/security_state/content/content_utils_unittest.cc b/components/security_state/content/content_utils_unittest.cc
index e0e37e0a45fd2ed2d059ba41574200378a67922b..090a835494dff613144b1fb5c45a5f67025f7bd3 100644
--- a/components/security_state/content/content_utils_unittest.cc
+++ b/components/security_state/content/content_utils_unittest.cc
@@ -4,6 +4,8 @@
#include "components/security_state/content/content_utils.h"
+#include <vector>
+
#include "base/command_line.h"
#include "base/test/histogram_tester.h"
#include "components/security_state/core/security_state.h"
@@ -253,6 +255,15 @@ TEST(SecurityStateContentUtilsTest, HTTPWarning) {
EXPECT_EQ(blink::kWebSecurityStyleNeutral, security_style);
// Verify only one explanation was shown when Form Not Secure is triggered.
EXPECT_EQ(1u, explanations.neutral_explanations.size());
+
+ // Verify that two explanations are shown when the Incognito and
+ // FormNotSecure flags are both set.
+ explanations.neutral_explanations.clear();
+ security_info.displayed_credit_card_field_on_http = true;
+ security_info.incognito_downgraded_security_level = true;
+ security_style = GetSecurityStyle(security_info, &explanations);
+ EXPECT_EQ(blink::kWebSecurityStyleNeutral, security_style);
+ EXPECT_EQ(2u, explanations.neutral_explanations.size());
}
// Tests that an explanation is provided if a certificate is missing a
« no previous file with comments | « components/security_state/content/content_utils.cc ('k') | components/security_state/core/security_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698