Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 SitePerProcessHighDPIBrowserTest() {} | 547 SitePerProcessHighDPIBrowserTest() {} |
| 548 | 548 |
| 549 protected: | 549 protected: |
| 550 void SetUpCommandLine(base::CommandLine* command_line) override { | 550 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 551 SitePerProcessBrowserTest::SetUpCommandLine(command_line); | 551 SitePerProcessBrowserTest::SetUpCommandLine(command_line); |
| 552 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, | 552 command_line->AppendSwitchASCII(switches::kForceDeviceScaleFactor, |
| 553 base::StringPrintf("2")); | 553 base::StringPrintf("2")); |
| 554 } | 554 } |
| 555 }; | 555 }; |
| 556 | 556 |
| 557 // SitePerProcessIgnoreCertErrorsBrowserTest | |
| 558 | |
| 559 class SitePerProcessIgnoreCertErrorsBrowserTest | |
| 560 : public SitePerProcessBrowserTest { | |
| 561 public: | |
| 562 SitePerProcessIgnoreCertErrorsBrowserTest() {} | |
| 563 | |
| 564 protected: | |
| 565 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 566 SitePerProcessBrowserTest::SetUpCommandLine(command_line); | |
| 567 command_line->AppendSwitch(switches::kIgnoreCertificateErrors); | |
| 568 } | |
| 569 }; | |
| 570 | |
| 557 // Ensure that navigating subframes in --site-per-process mode works and the | 571 // Ensure that navigating subframes in --site-per-process mode works and the |
| 558 // correct documents are committed. | 572 // correct documents are committed. |
| 559 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) { | 573 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) { |
| 560 GURL main_url(embedded_test_server()->GetURL( | 574 GURL main_url(embedded_test_server()->GetURL( |
| 561 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); | 575 "a.com", "/cross_site_iframe_factory.html?a(a,a(a,a(a)))")); |
| 562 NavigateToURL(shell(), main_url); | 576 NavigateToURL(shell(), main_url); |
| 563 | 577 |
| 564 // It is safe to obtain the root frame tree node here, as it doesn't change. | 578 // It is safe to obtain the root frame tree node here, as it doesn't change. |
| 565 FrameTreeNode* root = | 579 FrameTreeNode* root = |
| 566 static_cast<WebContentsImpl*>(shell()->web_contents())-> | 580 static_cast<WebContentsImpl*>(shell()->web_contents())-> |
| (...skipping 4087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4654 // RenderFrame will be properly created and there will be no crash. | 4668 // RenderFrame will be properly created and there will be no crash. |
| 4655 // Therefore, navigate the remaining subframe to completely different site, | 4669 // Therefore, navigate the remaining subframe to completely different site, |
| 4656 // which will cause the original process to exit cleanly. | 4670 // which will cause the original process to exit cleanly. |
| 4657 NavigateFrameToURL( | 4671 NavigateFrameToURL( |
| 4658 web_contents->GetFrameTree()->root()->child_at(0), | 4672 web_contents->GetFrameTree()->root()->child_at(0), |
| 4659 embedded_test_server()->GetURL("d.com", "/title3.html")); | 4673 embedded_test_server()->GetURL("d.com", "/title3.html")); |
| 4660 watcher.Wait(); | 4674 watcher.Wait(); |
| 4661 EXPECT_TRUE(watcher.did_exit_normally()); | 4675 EXPECT_TRUE(watcher.did_exit_normally()); |
| 4662 } | 4676 } |
| 4663 | 4677 |
| 4678 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.
| |
| 4679 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | |
| 4680 https_server.ServeFilesFromSourceDirectory("content/test/data"); | |
| 4681 ASSERT_TRUE(https_server.Start()); | |
| 4682 | |
| 4683 GURL url(https_server.GetURL("/mixed-content/basic-passive.html")); | |
| 4684 NavigateToURL(shell(), url); | |
| 4685 EXPECT_TRUE(shell()->web_contents()->DisplayedInsecureContent()); | |
| 4686 } | |
| 4687 | |
| 4688 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.
| |
| 4689 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
| |
| 4690 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | |
| 4691 https_server.ServeFilesFromSourceDirectory("content/test/data"); | |
| 4692 ASSERT_TRUE(https_server.Start()); | |
| 4693 | |
| 4694 GURL iframe_url( | |
| 4695 https_server.GetURL("/mixed-content/basic-passive-in-iframe.html")); | |
| 4696 NavigateToURL(shell(), iframe_url); | |
| 4697 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.
| |
| 4698 } | |
| 4699 | |
| 4700 IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest, | |
| 4701 PassiveMixedContentInIframeWithStrictBlocking) { | |
| 4702 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | |
| 4703 https_server.ServeFilesFromSourceDirectory("content/test/data"); | |
| 4704 ASSERT_TRUE(https_server.Start()); | |
| 4705 | |
| 4706 GURL iframe_url_with_strict_blocking(https_server.GetURL( | |
| 4707 "/mixed-content/basic-passive-in-iframe-with-strict-blocking.html")); | |
| 4708 NavigateToURL(shell(), iframe_url_with_strict_blocking); | |
| 4709 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.
| |
| 4710 } | |
| 4711 | |
| 4664 } // namespace content | 4712 } // namespace content |
| OLD | NEW |