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 6364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6375 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 6375 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
6376 ASSERT_EQ(1U, root->child_count()); | 6376 ASSERT_EQ(1U, root->child_count()); |
6377 FrameTreeNode* mixed_child = root->child_at(0)->child_at(0); | 6377 FrameTreeNode* mixed_child = root->child_at(0)->child_at(0); |
6378 ASSERT_TRUE(mixed_child); | 6378 ASSERT_TRUE(mixed_child); |
6379 // The child iframe attempted to create a mixed iframe; this should | 6379 // The child iframe attempted to create a mixed iframe; this should |
6380 // have been blocked, so the mixed iframe should not have committed a | 6380 // have been blocked, so the mixed iframe should not have committed a |
6381 // load. | 6381 // load. |
6382 EXPECT_FALSE(mixed_child->has_committed_real_load()); | 6382 EXPECT_FALSE(mixed_child->has_committed_real_load()); |
6383 } | 6383 } |
6384 | 6384 |
6385 // Test that subresources with certificate errors that are NOT redundant | 6385 // Test that subresources with certificate errors get reported to the |
6386 // with the main page DO get reported to the browser. That is, if | 6386 // browser. That is, if https://example.test frames https://a.com which |
6387 // https://nonredundant.test frames https://a.com which loads an image | 6387 // loads an image with certificate errors, the browser should be |
6388 // with certificate errors, the browser should be notified about the | 6388 // notified about the subresource with certificate errors and downgrade |
6389 // subresource with certificate errors and downgrade the UI | 6389 // the UI appropriately. |
6390 // appropriately. | |
6391 IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest, | 6390 IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest, |
6392 SubresourceWithNonRedundantCertificateErrors) { | 6391 SubresourceWithCertificateErrors) { |
6393 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); | 6392 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); |
6394 https_server.ServeFilesFromSourceDirectory("content/test/data"); | 6393 https_server.ServeFilesFromSourceDirectory("content/test/data"); |
6395 ASSERT_TRUE(https_server.Start()); | 6394 ASSERT_TRUE(https_server.Start()); |
6396 SetupCrossSiteRedirector(&https_server); | 6395 SetupCrossSiteRedirector(&https_server); |
6397 | 6396 |
6398 GURL url(https_server.GetURL( | 6397 GURL url(https_server.GetURL( |
6399 "nonredundant.test", | 6398 "example.test", |
6400 "/mixed-content/non-redundant-cert-error-in-iframe.html")); | 6399 "/mixed-content/non-redundant-cert-error-in-iframe.html")); |
6401 EXPECT_TRUE(NavigateToURL(shell(), url)); | 6400 EXPECT_TRUE(NavigateToURL(shell(), url)); |
6402 | 6401 |
6403 NavigationEntry* entry = | 6402 NavigationEntry* entry = |
6404 shell()->web_contents()->GetController().GetLastCommittedEntry(); | 6403 shell()->web_contents()->GetController().GetLastCommittedEntry(); |
6405 ASSERT_TRUE(entry); | 6404 ASSERT_TRUE(entry); |
6406 | 6405 |
6407 // The main page was loaded with certificate errors. | 6406 // The main page was loaded with certificate errors. |
6408 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, | 6407 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, |
6409 entry->GetSSL().security_style); | 6408 entry->GetSSL().security_style); |
6410 | 6409 |
6411 // The image that the iframe loaded had certificate errors also, and | 6410 // The image that the iframe loaded had certificate errors also, so |
6412 // they were different than the certificate errors of the main | 6411 // the page should be marked as having displayed subresources with |
6413 // resource, so the page should be marked as having displayed insecure | 6412 // cert errors. |
6414 // content. | |
6415 EXPECT_TRUE(entry->GetSSL().content_status & | 6413 EXPECT_TRUE(entry->GetSSL().content_status & |
6416 SSLStatus::DISPLAYED_INSECURE_CONTENT); | 6414 SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS); |
6417 } | 6415 } |
6418 | 6416 |
6419 // Test setting a cross-origin iframe to display: none. | 6417 // Test setting a cross-origin iframe to display: none. |
6420 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframeDisplayNone) { | 6418 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframeDisplayNone) { |
6421 GURL main_url(embedded_test_server()->GetURL( | 6419 GURL main_url(embedded_test_server()->GetURL( |
6422 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 6420 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
6423 NavigateToURL(shell(), main_url); | 6421 NavigateToURL(shell(), main_url); |
6424 | 6422 |
6425 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); | 6423 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
6426 RenderWidgetHost* root_render_widget_host = | 6424 RenderWidgetHost* root_render_widget_host = |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7642 root_frame_monitor.events_received()[5]); | 7640 root_frame_monitor.events_received()[5]); |
7643 EXPECT_EQ(blink::WebInputEvent::GestureScrollEnd, | 7641 EXPECT_EQ(blink::WebInputEvent::GestureScrollEnd, |
7644 root_frame_monitor.events_received()[6]); | 7642 root_frame_monitor.events_received()[6]); |
7645 | 7643 |
7646 // Verify child-RWHI gets no events. | 7644 // Verify child-RWHI gets no events. |
7647 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 7645 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
7648 } | 7646 } |
7649 #endif | 7647 #endif |
7650 | 7648 |
7651 } // namespace content | 7649 } // namespace content |
OLD | NEW |