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

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1391363002: Extend components/test_runner's generated WebMediaStream to have a Chrome VideoTrack and Source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index 2233563cca55e359145d1822a985d36a1c964fef..f5d6dcdf978b821c6b2a6fc5b4cf385117a3aaad 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -35,6 +35,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/public/common/web_preferences.h"
+#include "content/public/renderer/media_stream_api.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_visitor.h"
@@ -222,6 +223,23 @@ class MockGamepadProvider : public RendererGamepadProvider {
DISALLOW_COPY_AND_ASSIGN(MockGamepadProvider);
};
+class MockVideoCapturerSource : public media::VideoCapturerSource {
+ public:
+ MockVideoCapturerSource() = default;
+ ~MockVideoCapturerSource() override {}
+
+ void GetCurrentSupportedFormats(
+ int max_requested_width,
+ int max_requested_height,
+ double max_requested_frame_rate,
+ const VideoCaptureDeviceFormatsCB& callback) override {}
+ void StartCapture(
+ const media::VideoCaptureParams& params,
+ const VideoCaptureDeliverFrameCB& new_frame_callback,
+ const RunningCallback& running_callback) override {}
+ void StopCapture() override {}
+};
+
} // namespace
BlinkTestRunner::BlinkTestRunner(RenderView* render_view)
@@ -715,6 +733,20 @@ void BlinkTestRunner::OnWebTestProxyBaseDestroy(
test_runner::WebTestProxyBase* proxy) {
}
+bool BlinkTestRunner::AddMediaStreamSourceAndTrack(
+ blink::WebMediaStream* stream) {
+ DCHECK(stream);
+#if defined(ENABLE_WEBRTC)
+ return AddVideoTrackToMediaStream(
+ make_scoped_ptr(new MockVideoCapturerSource()),
+ false /* is_remote */,
+ false /* is_readonly */,
+ stream);
+#else
+ return false;
+#endif
+}
+
// RenderViewObserver --------------------------------------------------------
void BlinkTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698