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

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: Move console log to Navigation completion 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
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..542326388fcc0e430c2518f253e219836a631434 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.is_incognito = 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

Powered by Google App Engine
This is Rietveld 408576698