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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1550723003: Adapt MixedContentChecker for remote frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add some basic browser tests, fix a replication state bug that the test found Created 4 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
« no previous file with comments | « no previous file | content/common/frame_messages.h » ('j') | content/common/frame_messages.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 9d2a95b9c413b5f5eccd3305c357aa3390150b49..e1acd1a29d9b908264a4f82e1870c71a939406f7 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -554,6 +554,20 @@ class SitePerProcessHighDPIBrowserTest : public SitePerProcessBrowserTest {
}
};
+// SitePerProcessIgnoreCertErrorsBrowserTest
+
+class SitePerProcessIgnoreCertErrorsBrowserTest
+ : public SitePerProcessBrowserTest {
+ public:
+ SitePerProcessIgnoreCertErrorsBrowserTest() {}
+
+ protected:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ SitePerProcessBrowserTest::SetUpCommandLine(command_line);
+ command_line->AppendSwitch(switches::kIgnoreCertificateErrors);
+ }
+};
+
// Ensure that navigating subframes in --site-per-process mode works and the
// correct documents are committed.
IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
@@ -4661,4 +4675,38 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ParentDetachRemoteChild) {
EXPECT_TRUE(watcher.did_exit_normally());
}
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, PassiveMixedContent) {
alexmos 2016/01/16 00:49:50 Hmm, it doesn't look like this test exercises any
estark 2016/01/20 05:56:22 Hmm... actually, maybe we don't need this test at
alexmos 2016/01/20 22:43:55 That sounds good to me. Let's remove this one and
estark 2016/01/21 04:40:13 Done.
+ net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
+ https_server.ServeFilesFromSourceDirectory("content/test/data");
+ ASSERT_TRUE(https_server.Start());
+
+ GURL url(https_server.GetURL("/mixed-content/basic-passive.html"));
+ NavigateToURL(shell(), url);
+ EXPECT_TRUE(shell()->web_contents()->DisplayedInsecureContent());
+}
+
+IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest,
alexmos 2016/01/16 00:49:50 A comment about why these tests need to ignore cer
estark 2016/01/20 05:56:22 Done.
+ PassiveMixedContentInIframe) {
alexmos 2016/01/20 22:43:55 Do you plan to add similar tests for active mixed
estark 2016/01/21 04:40:13 I should have done that earlier, sorry. I just add
alexmos 2016/01/21 18:13:28 What do you think about flipping things to instead
alexmos 2016/01/21 18:21:51 Also, if you did want to override that setting fro
+ net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
+ https_server.ServeFilesFromSourceDirectory("content/test/data");
+ ASSERT_TRUE(https_server.Start());
+
+ GURL iframe_url(
+ https_server.GetURL("/mixed-content/basic-passive-in-iframe.html"));
+ NavigateToURL(shell(), iframe_url);
+ EXPECT_TRUE(shell()->web_contents()->DisplayedInsecureContent());
alexmos 2016/01/16 00:49:50 Does navigating the subframe to another (secure) c
estark 2016/01/20 05:56:22 Done.
+}
+
+IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest,
+ PassiveMixedContentInIframeWithStrictBlocking) {
+ net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
+ https_server.ServeFilesFromSourceDirectory("content/test/data");
+ ASSERT_TRUE(https_server.Start());
+
+ GURL iframe_url_with_strict_blocking(https_server.GetURL(
+ "/mixed-content/basic-passive-in-iframe-with-strict-blocking.html"));
+ NavigateToURL(shell(), iframe_url_with_strict_blocking);
+ EXPECT_FALSE(shell()->web_contents()->DisplayedInsecureContent());
alexmos 2016/01/16 00:49:50 Maybe also check the strict mixed content flags st
estark 2016/01/20 05:56:22 Done.
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/common/frame_messages.h » ('j') | content/common/frame_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698