From bba89d313476af018a1fcc7774262c9b65d9e9fc Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" Date: Thu, 16 Oct 2008 20:19:48 +0000 Subject: When a mixed-content resource was loaded, we would apply the mixed-content state to the active entry, which would be the pending entry if there is one. That caused a problem in cases where a bad resource is loading and we are initiating a navigation from the browser (and therefore creating a pending entry). More details: In the GoodFrame test, the top-frame is HTTPS and we load an HTTP frame with an image. As soon as the bad frame has loaded, we navigate back (creating a pending entry). In rare cases, the notification for the mixed-content image of the HTTP frame would happen after the back action, mistakingly setting the mixed-content state on the pending entry. BUG=2742 TEST=Run the SSL UI tests 1000 times. Review URL: http://codereview.chromium.org/7440 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3480 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ssl_policy.cc | 3 ++- chrome/browser/ssl_uitest.cc | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/chrome/browser/ssl_policy.cc b/chrome/browser/ssl_policy.cc index a93b31d..099f5c0 100644 --- a/chrome/browser/ssl_policy.cc +++ b/chrome/browser/ssl_policy.cc @@ -317,7 +317,8 @@ class DefaultPolicy : public SSLPolicy { } mixed_content_handler->StartRequest(filter_policy); - NavigationEntry* entry = navigation_controller->GetActiveEntry(); + NavigationEntry* entry = navigation_controller->GetLastCommittedEntry(); + DCHECK(entry); // Even though we are loading the mixed-content resource, it will not be // included in the page when we set the policy to FILTER_ALL or // FILTER_ALL_EXCEPT_IMAGES (only images and they are stamped with warning diff --git a/chrome/browser/ssl_uitest.cc b/chrome/browser/ssl_uitest.cc index 989fdbb..4446a02 100644 --- a/chrome/browser/ssl_uitest.cc +++ b/chrome/browser/ssl_uitest.cc @@ -202,8 +202,7 @@ TEST_F(SSLUITest, TestHTTPSExpiredCert) { // // Visits a page with mixed content. -// Diasbled for flackiness (bug #2742). -TEST_F(SSLUITest, DISABLED_TestMixedContents) { +TEST_F(SSLUITest, TestMixedContents) { HTTPSTestServer https_server(kHostName, kOKHTTPSPort, kDocRoot, GetOKCertPath()); TestServer http_server(kDocRoot); @@ -717,8 +716,7 @@ TEST_F(SSLUITest, TestConnectToBadPort) { // - navigate to a bad HTTPS (expect unsafe content and filtered frame), then // back // - navigate to HTTP (expect mixed content), then back -// Disabled for flackiness (bug #2742). -TEST_F(SSLUITest, DISABLED_TestGoodFrameNavigation) { +TEST_F(SSLUITest, TestGoodFrameNavigation) { TestServer http_server(kDocRoot); HTTPSTestServer good_https_server(kHostName, kOKHTTPSPort, kDocRoot, GetOKCertPath()); -- cgit v1.1