Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: webkit/mocks/test_media_stream_client.cc

Issue 13159005: Enable media stream layout test with content_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/mocks/test_media_stream_client.h ('k') | webkit/support/test_media_stream_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/mocks/test_media_stream_client.cc
===================================================================
--- webkit/mocks/test_media_stream_client.cc (revision 191708)
+++ webkit/mocks/test_media_stream_client.cc (working copy)
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/support/test_media_stream_client.h"
+#include "webkit/mocks/test_media_stream_client.h"
#include "googleurl/src/gurl.h"
+#include "media/base/media_log.h"
#include "media/base/pipeline.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamTrack.h"
@@ -12,6 +13,9 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaStreamRegistry.h"
#include "webkit/media/media_stream_audio_renderer.h"
#include "webkit/media/simple_video_frame_provider.h"
+#include "webkit/media/webmediaplayer_impl.h"
+#include "webkit/media/webmediaplayer_ms.h"
+#include "webkit/media/webmediaplayer_params.h"
using namespace WebKit;
@@ -22,6 +26,7 @@
static const int kVideoCaptureFrameDurationMs = 33;
bool IsMockMediaStreamWithVideo(const WebURL& url) {
+#if ENABLE_WEBRTC
WebMediaStream descriptor(
WebMediaStreamRegistry::lookupMediaStreamDescriptor(url));
if (descriptor.isNull())
@@ -29,12 +34,42 @@
WebVector<WebMediaStreamTrack> videoSources;
descriptor.videoSources(videoSources);
return videoSources.size() > 0;
+#else
+ return false;
+#endif
}
} // namespace
-namespace webkit_support {
+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() {}
@@ -63,4 +98,4 @@
return NULL;
}
-} // namespace webkit_support
+} // namespace webkit_glue
« no previous file with comments | « webkit/mocks/test_media_stream_client.h ('k') | webkit/support/test_media_stream_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698