summaryrefslogtreecommitdiffstats
path: root/webkit/mocks/test_media_stream_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/mocks/test_media_stream_client.cc')
-rw-r--r--webkit/mocks/test_media_stream_client.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/webkit/mocks/test_media_stream_client.cc b/webkit/mocks/test_media_stream_client.cc
index 3065612..632f6b39 100644
--- a/webkit/mocks/test_media_stream_client.cc
+++ b/webkit/mocks/test_media_stream_client.cc
@@ -13,6 +13,9 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaStreamRegistry.h"
#include "webkit/renderer/media/media_stream_audio_renderer.h"
#include "webkit/renderer/media/simple_video_frame_provider.h"
+#include "webkit/renderer/media/webmediaplayer_impl.h"
+#include "webkit/renderer/media/webmediaplayer_ms.h"
+#include "webkit/renderer/media/webmediaplayer_params.h"
using namespace WebKit;
@@ -40,6 +43,33 @@ bool IsMockMediaStreamWithVideo(const WebURL& url) {
namespace webkit_glue {
+WebKit::WebMediaPlayer* CreateMediaPlayer(
+ WebFrame* frame,
+ const WebURL& url,
+ WebMediaPlayerClient* client,
+ webkit_media::MediaStreamClient* media_stream_client) {
+ if (media_stream_client && media_stream_client->IsMediaStream(url)) {
+ return new webkit_media::WebMediaPlayerMS(
+ frame,
+ client,
+ base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
+ media_stream_client,
+ new media::MediaLog());
+ }
+
+#if defined(OS_ANDROID)
+ return NULL;
+#else
+ webkit_media::WebMediaPlayerParams params(
+ NULL, NULL, new media::MediaLog());
+ return new webkit_media::WebMediaPlayerImpl(
+ frame,
+ client,
+ base::WeakPtr<webkit_media::WebMediaPlayerDelegate>(),
+ params);
+#endif
+}
+
TestMediaStreamClient::TestMediaStreamClient() {}
TestMediaStreamClient::~TestMediaStreamClient() {}