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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2226523002: Add separate plumbing for subresources with certificate errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo 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 unified diff | Download patch
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | content/browser/ssl/ssl_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6392 matching lines...) Expand 10 before | Expand all | Expand 10 after
6403 ASSERT_TRUE(entry); 6403 ASSERT_TRUE(entry);
6404 6404
6405 // The main page was loaded with certificate errors. 6405 // The main page was loaded with certificate errors.
6406 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, 6406 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN,
6407 entry->GetSSL().security_style); 6407 entry->GetSSL().security_style);
6408 6408
6409 // The image that the iframe loaded had certificate errors also, but 6409 // The image that the iframe loaded had certificate errors also, but
6410 // they were redundant with the main resource, so the page should not 6410 // they were redundant with the main resource, so the page should not
6411 // be marked as displaying insecure content. 6411 // be marked as displaying insecure content.
6412 EXPECT_FALSE(entry->GetSSL().content_status & 6412 EXPECT_FALSE(entry->GetSSL().content_status &
6413 SSLStatus::DISPLAYED_INSECURE_CONTENT); 6413 SSLStatus::DISPLAYED_CONTENT_WITH_CERTIFICATE_ERRORS);
6414 } 6414 }
6415 6415
6416 // Test that subresources with certificate errors that are NOT redundant 6416 // Test that subresources with certificate errors that are NOT redundant
6417 // with the main page DO get reported to the browser. That is, if 6417 // with the main page DO get reported to the browser. That is, if
6418 // https://nonredundant.test frames https://a.com which loads an image 6418 // https://nonredundant.test frames https://a.com which loads an image
6419 // with certificate errors, the browser should be notified about the 6419 // with certificate errors, the browser should be notified about the
6420 // subresource with certificate errors and downgrade the UI 6420 // subresource with certificate errors and downgrade the UI
6421 // appropriately. 6421 // appropriately.
6422 IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest, 6422 IN_PROC_BROWSER_TEST_F(SitePerProcessIgnoreCertErrorsBrowserTest,
6423 SubresourceWithNonRedundantCertificateErrors) { 6423 SubresourceWithNonRedundantCertificateErrors) {
(...skipping 13 matching lines...) Expand all
6437 6437
6438 // The main page was loaded with certificate errors. 6438 // The main page was loaded with certificate errors.
6439 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN, 6439 EXPECT_EQ(SECURITY_STYLE_AUTHENTICATION_BROKEN,
6440 entry->GetSSL().security_style); 6440 entry->GetSSL().security_style);
6441 6441
6442 // The image that the iframe loaded had certificate errors also, and 6442 // The image that the iframe loaded had certificate errors also, and
6443 // they were different than the certificate errors of the main 6443 // they were different than the certificate errors of the main
6444 // resource, so the page should be marked as having displayed insecure 6444 // resource, so the page should be marked as having displayed insecure
6445 // content. 6445 // content.
6446 EXPECT_TRUE(entry->GetSSL().content_status & 6446 EXPECT_TRUE(entry->GetSSL().content_status &
6447 SSLStatus::DISPLAYED_INSECURE_CONTENT); 6447 SSLStatus::DISPLAYED_CONTENT_WITH_CERTIFICATE_ERRORS);
6448 } 6448 }
6449 6449
6450 // Test setting a cross-origin iframe to display: none. 6450 // Test setting a cross-origin iframe to display: none.
6451 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframeDisplayNone) { 6451 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframeDisplayNone) {
6452 GURL main_url(embedded_test_server()->GetURL( 6452 GURL main_url(embedded_test_server()->GetURL(
6453 "a.com", "/cross_site_iframe_factory.html?a(b)")); 6453 "a.com", "/cross_site_iframe_factory.html?a(b)"));
6454 NavigateToURL(shell(), main_url); 6454 NavigateToURL(shell(), main_url);
6455 6455
6456 FrameTreeNode* root = web_contents()->GetFrameTree()->root(); 6456 FrameTreeNode* root = web_contents()->GetFrameTree()->root();
6457 RenderWidgetHost* root_render_widget_host = 6457 RenderWidgetHost* root_render_widget_host =
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
7494 7494
7495 shell()->web_contents()->WasShown(); 7495 shell()->web_contents()->WasShown();
7496 7496
7497 EXPECT_TRUE(ExecuteScriptAndExtractInt( 7497 EXPECT_TRUE(ExecuteScriptAndExtractInt(
7498 root->child_at(0)->current_frame_host(), 7498 root->child_at(0)->current_frame_host(),
7499 "window.domAutomationController.send(event_fired);", &event_fired)); 7499 "window.domAutomationController.send(event_fired);", &event_fired));
7500 EXPECT_EQ(2, event_fired); 7500 EXPECT_EQ(2, event_fired);
7501 } 7501 }
7502 7502
7503 } // namespace content 7503 } // namespace content
OLDNEW
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | content/browser/ssl/ssl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698