diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 09:25:00 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 09:25:00 +0000 |
commit | 247df2be0e6a352eb5d74edf0e55bc1914f2f062 (patch) | |
tree | a0831db9c24c64cd716a880a4890e4d0e94fa458 /content | |
parent | af1c80975b73fa4b600154be23bbaaa13d9745a3 (diff) | |
download | chromium_src-247df2be0e6a352eb5d74edf0e55bc1914f2f062.zip chromium_src-247df2be0e6a352eb5d74edf0e55bc1914f2f062.tar.gz chromium_src-247df2be0e6a352eb5d74edf0e55bc1914f2f062.tar.bz2 |
[content shell] use the TestShell mime registry for layout tests
We need to disable certain codecs to pass the media tests. Also the
prefetch tests print the mime type of the prefetched resources which
differs between DRT and the content module
BUG=111316
TEST=media/ tests pass
R=creis@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12316138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184913 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
5 files changed, 26 insertions, 0 deletions
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc index 8d2b99b1..13f4d5b 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc @@ -63,6 +63,10 @@ WebKit::WebClipboard* ContentRendererClient::OverrideWebClipboard() { return NULL; } +WebKit::WebMimeRegistry* ContentRendererClient::OverrideWebMimeRegistry() { + return NULL; +} + bool ContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { return true; } diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index 4c2deeb..bbc078f 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -30,6 +30,7 @@ class WebFrame; class WebMediaPlayerClient; class WebMediaStreamCenter; class WebMediaStreamCenterClient; +class WebMimeRegistry; class WebPlugin; class WebRTCPeerConnectionHandler; class WebRTCPeerConnectionHandlerClient; @@ -139,6 +140,10 @@ class CONTENT_EXPORT ContentRendererClient { // returns NULL the content layer will handle clipboard interactions. virtual WebKit::WebClipboard* OverrideWebClipboard(); + // Allows the embedder to override the WebKit::WebMimeRegistry used. If it + // returns NULL the content layer will provide its own mime registry. + virtual WebKit::WebMimeRegistry* OverrideWebMimeRegistry(); + // Returns true if the renderer process should schedule the idle handler when // all widgets are hidden. virtual bool RunIdleHandlerWhenWidgetsHidden(); diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index 24f7e7b..3f88b32 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -208,6 +208,10 @@ WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { } WebKit::WebMimeRegistry* RendererWebKitPlatformSupportImpl::mimeRegistry() { + WebKit::WebMimeRegistry* mime_registry = + GetContentClient()->renderer()->OverrideWebMimeRegistry(); + if (mime_registry) + return mime_registry; return mime_registry_.get(); } diff --git a/content/shell/shell_content_renderer_client.cc b/content/shell/shell_content_renderer_client.cc index 79e9c16..cb2363a 100644 --- a/content/shell/shell_content_renderer_client.cc +++ b/content/shell/shell_content_renderer_client.cc @@ -21,11 +21,13 @@ #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h" #include "v8/include/v8.h" #include "webkit/tools/test_shell/mock_webclipboard_impl.h" +#include "webkit/tools/test_shell/test_shell_webmimeregistry_impl.h" using WebKit::WebClipboard; using WebKit::WebFrame; using WebKit::WebMediaStreamCenter; using WebKit::WebMediaStreamCenterClient; +using WebKit::WebMimeRegistry; using WebKit::WebPlugin; using WebKit::WebPluginParams; using WebKit::WebRTCPeerConnectionHandler; @@ -120,6 +122,14 @@ WebClipboard* ShellContentRendererClient::OverrideWebClipboard() { return clipboard_.get(); } +WebMimeRegistry* ShellContentRendererClient::OverrideWebMimeRegistry() { + if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) + return NULL; + if (!mime_registry_) + mime_registry_.reset(new TestShellWebMimeRegistryImpl); + return mime_registry_.get(); +} + void ShellContentRendererClient::WebTestProxyCreated(RenderView* render_view, WebTestProxyBase* proxy) { WebKitTestRunner* test_runner = new WebKitTestRunner(render_view); diff --git a/content/shell/shell_content_renderer_client.h b/content/shell/shell_content_renderer_client.h index 659e9ec..f561072 100644 --- a/content/shell/shell_content_renderer_client.h +++ b/content/shell/shell_content_renderer_client.h @@ -20,6 +20,7 @@ class WebTestProxyBase; } class MockWebClipboardImpl; +class TestShellWebMimeRegistryImpl; namespace content { @@ -42,6 +43,7 @@ class ShellContentRendererClient : public ContentRendererClient { OverrideCreateWebRTCPeerConnectionHandler( WebKit::WebRTCPeerConnectionHandlerClient* client) OVERRIDE; virtual WebKit::WebClipboard* OverrideWebClipboard() OVERRIDE; + virtual WebKit::WebMimeRegistry* OverrideWebMimeRegistry() OVERRIDE; private: void WebTestProxyCreated(RenderView* render_view, @@ -49,6 +51,7 @@ class ShellContentRendererClient : public ContentRendererClient { scoped_ptr<ShellRenderProcessObserver> shell_observer_; scoped_ptr<MockWebClipboardImpl> clipboard_; + scoped_ptr<TestShellWebMimeRegistryImpl> mime_registry_; }; } // namespace content |