diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:45:51 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-25 17:45:51 +0000 |
commit | 8380c0910bfff5ee0af6b37536cd815023d055ef (patch) | |
tree | e8a4850c7aa9738f1fc3706cdbcd32efd6f77b6e /webkit/tools/test_shell | |
parent | 5de4b03e3bcd97feae59de8828704088f97c5705 (diff) | |
download | chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.zip chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.gz chromium_src-8380c0910bfff5ee0af6b37536cd815023d055ef.tar.bz2 |
Refactorying to create the ResourceLoaderBridge through a factory class for <video>
Extract the code to create a ResourceLoaderBridge to a factory class
to enable testing on the data source filters.
Review URL: http://codereview.chromium.org/146007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/test_shell.gyp | 1 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_webview_delegate.cc | 22 |
2 files changed, 21 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp index ec42d92..c57a376 100644 --- a/webkit/tools/test_shell/test_shell.gyp +++ b/webkit/tools/test_shell/test_shell.gyp @@ -460,6 +460,7 @@ '../../glue/dom_serializer_unittest.cc', '../../glue/glue_serialize_unittest.cc', '../../glue/iframe_redirect_unittest.cc', + '../../glue/media/media_resource_loader_bridge_factory_unittest.cc', '../../glue/mimetype_unittest.cc', '../../glue/multipart_response_delegate_unittest.cc', '../../glue/password_autocomplete_listener_unittest.cc', diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index be1f75a..91aa19b 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -14,6 +14,7 @@ #include "base/gfx/point.h" #include "base/gfx/native_widget_types.h" #include "base/message_loop.h" +#include "base/process_util.h" #include "base/string_util.h" #include "base/trace_event.h" #include "net/base/net_errors.h" @@ -25,6 +26,9 @@ #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebURLError.h" #include "webkit/api/public/WebURLRequest.h" +#include "webkit/glue/media/media_resource_loader_bridge_factory.h" +#include "webkit/glue/media/simple_data_source.h" +#include "webkit/glue/webappcachecontext.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webframe.h" #include "webkit/glue/webpreferences.h" @@ -124,8 +128,22 @@ WebWidget* TestWebViewDelegate::CreatePopupWidget(WebView* webview, WebKit::WebMediaPlayer* TestWebViewDelegate::CreateWebMediaPlayer( WebKit::WebMediaPlayerClient* client) { - return new webkit_glue::WebMediaPlayerImpl( - client, new media::FilterFactoryCollection()); + scoped_refptr<media::FilterFactoryCollection> factory = + new media::FilterFactoryCollection(); + + // TODO(hclam): this is the same piece of code as in RenderView, maybe they + // should be grouped together. + webkit_glue::MediaResourceLoaderBridgeFactory* bridge_factory = + new webkit_glue::MediaResourceLoaderBridgeFactory( + GURL::EmptyGURL(), // referrer + "null", // frame origin + "null", // main_frame_origin + base::GetCurrentProcId(), + WebAppCacheContext::kNoAppCacheContextId, + 0); + factory->AddFactory(webkit_glue::SimpleDataSource::CreateFactory( + MessageLoop::current(), bridge_factory)); + return new webkit_glue::WebMediaPlayerImpl(client, factory); } WebWorker* TestWebViewDelegate::CreateWebWorker(WebWorkerClient* client) { |