diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 16:20:09 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 16:20:09 +0000 |
commit | 19e1200e9b2dc55b8b620ae9eeaff025828277ad (patch) | |
tree | e2a3ed06977994b659565df44a58a89a6be8c003 | |
parent | 691c7ea419dd4abe41a5171255a512a57745d9b4 (diff) | |
download | chromium_src-19e1200e9b2dc55b8b620ae9eeaff025828277ad.zip chromium_src-19e1200e9b2dc55b8b620ae9eeaff025828277ad.tar.gz chromium_src-19e1200e9b2dc55b8b620ae9eeaff025828277ad.tar.bz2 |
Fix some mixed content layout tests.
1. Make test shell ignore certificate errors.
2. Extend WebFrameClient for new notifications and printf these.
R=abarth
BUG=21644
TEST=covered by layout tests
Review URL: http://codereview.chromium.org/200110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26108 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/renderer/render_view.h | 3 | ||||
-rw-r--r-- | webkit/api/public/WebFrameClient.h | 10 | ||||
-rw-r--r-- | webkit/glue/empty_webframeclient.h | 3 | ||||
-rw-r--r-- | webkit/glue/webframeloaderclient_impl.cc | 8 | ||||
-rw-r--r-- | webkit/tools/layout_tests/test_expectations.txt | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_resource_loader_bridge.cc | 7 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 11 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.h | 3 |
8 files changed, 44 insertions, 3 deletions
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index e9cdec9..f9d3784 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -357,6 +357,9 @@ class RenderView : public RenderWidget, virtual void didLoadResourceFromMemoryCache( WebKit::WebFrame* frame, const WebKit::WebURLRequest& request, const WebKit::WebURLResponse&); + virtual void didDisplayInsecureContent(WebKit::WebFrame* frame) {} + virtual void didRunInsecureContent( + WebKit::WebFrame* frame, const WebKit::WebString& security_origin) {} virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame); virtual void didChangeContentsSize( WebKit::WebFrame* frame, const WebKit::WebSize& size); diff --git a/webkit/api/public/WebFrameClient.h b/webkit/api/public/WebFrameClient.h index 5ca22a2..a126bb5 100644 --- a/webkit/api/public/WebFrameClient.h +++ b/webkit/api/public/WebFrameClient.h @@ -198,6 +198,16 @@ namespace WebKit { virtual void didLoadResourceFromMemoryCache( WebFrame*, const WebURLRequest&, const WebURLResponse&) = 0; + // This frame has displayed inactive content (such as an image) from an + // insecure source. Inactive content cannot spread to other frames. + virtual void didDisplayInsecureContent(WebFrame*) = 0; + + // The indicated security origin has run active content (such as a + // script) from an insecure source. Note that the insecure content can + // spread to other frames in the same origin. + virtual void didRunInsecureContent( + WebFrame*, const WebString& securityOrigin) = 0; + // Script notifications ------------------------------------------------ diff --git a/webkit/glue/empty_webframeclient.h b/webkit/glue/empty_webframeclient.h index 1d7e444..bc472fd 100644 --- a/webkit/glue/empty_webframeclient.h +++ b/webkit/glue/empty_webframeclient.h @@ -80,6 +80,9 @@ class EmptyWebFrameClient : public WebKit::WebFrameClient { virtual void didLoadResourceFromMemoryCache( WebKit::WebFrame* frame, const WebKit::WebURLRequest& request, const WebKit::WebURLResponse&) {} + virtual void didDisplayInsecureContent(WebKit::WebFrame* frame) {} + virtual void didRunInsecureContent( + WebKit::WebFrame* frame, const WebKit::WebString& security_origin) {} virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame* frame) {} virtual void didChangeContentsSize( WebKit::WebFrame* frame, const WebKit::WebSize& size) {} diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc index a098f10..d08377c 100644 --- a/webkit/glue/webframeloaderclient_impl.cc +++ b/webkit/glue/webframeloaderclient_impl.cc @@ -987,9 +987,15 @@ bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem*) const { } void WebFrameLoaderClient::didDisplayInsecureContent() { + if (webframe_->client()) + webframe_->client()->didDisplayInsecureContent(webframe_); } -void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin*) { +void WebFrameLoaderClient::didRunInsecureContent(SecurityOrigin* origin) { + if (webframe_->client()) { + webframe_->client()->didRunInsecureContent(webframe_, + webkit_glue::StringToWebString(origin->toString())); + } } ResourceError WebFrameLoaderClient::blockedError(const WebCore::ResourceRequest&) { diff --git a/webkit/tools/layout_tests/test_expectations.txt b/webkit/tools/layout_tests/test_expectations.txt index a7be26f..08094a6 100644 --- a/webkit/tools/layout_tests/test_expectations.txt +++ b/webkit/tools/layout_tests/test_expectations.txt @@ -2326,7 +2326,5 @@ BUG21644 : LayoutTests/http/tests/security/mixedContent/data-url-iframe-in-main- BUG21644 : LayoutTests/http/tests/security/mixedContent/insecure-css-in-main-frame.html = FAIL BUG21644 : LayoutTests/http/tests/security/mixedContent/insecure-iframe-in-main-frame.html = FAIL BUG21644 : LayoutTests/http/tests/security/mixedContent/insecure-image-in-main-frame.html = FAIL -BUG21644 : LayoutTests/http/tests/security/mixedContent/insecure-script-in-iframe.html = FAIL BUG21644 : LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame.html = FAIL -BUG21644 : LayoutTests/http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe.html = FAIL BUG21644 : LayoutTests/http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html = FAIL diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index 98378bb..142ab5e 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -313,6 +313,13 @@ class RequestProxy : public URLRequest::Delegate, } } + virtual void OnSSLCertificateError(URLRequest* request, + int cert_error, + net::X509Certificate* cert) { + // Allow all certificate errors. + request->ContinueDespiteLastError(); + } + virtual void OnReadCompleted(URLRequest* request, int bytes_read) { if (request->status().is_success() && bytes_read > 0) { OnReceivedData(bytes_read); diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index af0d5f8..b69d855 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -895,6 +895,17 @@ void TestWebViewDelegate::didLoadResourceFromMemoryCache( const WebURLResponse&) { } +void TestWebViewDelegate::didDisplayInsecureContent(WebFrame* frame) { + if (shell_->ShouldDumpFrameLoadCallbacks()) + printf("didDisplayInsecureContent\n"); +} + +void TestWebViewDelegate::didRunInsecureContent( + WebFrame* frame, const WebString& security_origin) { + if (shell_->ShouldDumpFrameLoadCallbacks()) + printf("didRunInsecureContent\n"); +} + void TestWebViewDelegate::didExhaustMemoryAvailableForScript(WebFrame* frame) { } diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index 46ff7b6..8e3e99a 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -216,6 +216,9 @@ class TestWebViewDelegate : public WebViewDelegate, virtual void didLoadResourceFromMemoryCache( WebKit::WebFrame*, const WebKit::WebURLRequest&, const WebKit::WebURLResponse&); + virtual void didDisplayInsecureContent(WebKit::WebFrame* frame); + virtual void didRunInsecureContent( + WebKit::WebFrame* frame, const WebKit::WebString& security_origin); virtual void didExhaustMemoryAvailableForScript(WebKit::WebFrame*); virtual void didChangeContentsSize( WebKit::WebFrame*, const WebKit::WebSize&); |