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

Unified Diff: chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc

Issue 2225213004: Teach SSLHostStateDelegate about subresources with cert errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc
diff --git a/chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc b/chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc
index 70fa4591eb1c9a597b14fc07ced85516d4dd781e..d98816528788f6bb7c0559d56a57feef1085177a 100644
--- a/chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc
+++ b/chrome/browser/ssl/chrome_ssl_host_state_delegate_test.cc
@@ -196,21 +196,50 @@ IN_PROC_BROWSER_TEST_F(ChromeSSLHostStateDelegateTest,
Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
content::SSLHostStateDelegate* state = profile->GetSSLHostStateDelegate();
- EXPECT_FALSE(state->DidHostRunInsecureContent("www.google.com", 42));
- EXPECT_FALSE(state->DidHostRunInsecureContent("www.google.com", 191));
- EXPECT_FALSE(state->DidHostRunInsecureContent("example.com", 42));
-
- state->HostRanInsecureContent("www.google.com", 42);
-
- EXPECT_TRUE(state->DidHostRunInsecureContent("www.google.com", 42));
- EXPECT_FALSE(state->DidHostRunInsecureContent("www.google.com", 191));
- EXPECT_FALSE(state->DidHostRunInsecureContent("example.com", 42));
-
- state->HostRanInsecureContent("example.com", 42);
-
- EXPECT_TRUE(state->DidHostRunInsecureContent("www.google.com", 42));
- EXPECT_FALSE(state->DidHostRunInsecureContent("www.google.com", 191));
- EXPECT_TRUE(state->DidHostRunInsecureContent("example.com", 42));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 191, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+
+ state->HostRanInsecureContent("www.google.com", 42,
+ content::SSLHostStateDelegate::MIXED_CONTENT);
+
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "www.google.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 191, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+
+ state->HostRanInsecureContent("example.com", 42,
+ content::SSLHostStateDelegate::MIXED_CONTENT);
+
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "www.google.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 191, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+
+ state->HostRanInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::CERT_ERRORS_CONTENT);
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 191, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::MIXED_CONTENT));
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "example.com", 42, content::SSLHostStateDelegate::CERT_ERRORS_CONTENT));
+
+ state->HostRanInsecureContent(
jww 2016/08/11 18:50:15 This looks identical to the set of tests right abo
estark 2016/08/11 20:58:38 As best as I can interpret past-Emily's intentions
+ "www.google.com", 191,
+ content::SSLHostStateDelegate::CERT_ERRORS_CONTENT);
+ EXPECT_TRUE(state->DidHostRunInsecureContent(
+ "www.google.com", 191,
+ content::SSLHostStateDelegate::CERT_ERRORS_CONTENT));
+ EXPECT_FALSE(state->DidHostRunInsecureContent(
+ "www.google.com", 191, content::SSLHostStateDelegate::MIXED_CONTENT));
}
// Test the migration code needed as a result of changing how the content

Powered by Google App Engine
This is Rietveld 408576698