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

Unified Diff: third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + tommi's comment Created 4 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
Index: third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html
diff --git a/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html
new file mode 100644
index 0000000000000000000000000000000000000000..9a0447cf0052810683542e1391f2e49296381e5d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <video id="testVideo" autoplay="autoplay"></video>
+ <div id="log"></div>
+ <p>Test assigment of a mediastream via the srcObject attribute.</p>
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="./w3c-media-utils.js"></script>
+ <script>
+ var test = async_test("srcObject test");
+ var video = document.getElementById("testVideo");
+
+ function startTest()
+ {
+ test.step(() => assert_idl_attribute(video, "srcObject"));
+ video.addEventListener("playing", playingSrcObject);
+ test.step(_ => assert_equals(video.srcObject, null));
+ test.step(_ => assert_equals(video.currentSrc, ""));
+ navigator.webkitGetUserMedia(
+ {video:true},
+ stream => video.srcObject = stream,
+ _ => test.step(() => assert_unreached("Did not get mediastream")));
+ }
+
+ function playingSrcObject()
+ {
+ video.removeEventListener("playing", playingSrcObject)
+ video.addEventListener("emptied", playingNothing)
+ test.step(() => assert_not_equals(video.srcObject, null));
+ test.step(() => assert_class_string(video.srcObject, "MediaStream"));
+ test.step(() => assert_equals(video.currentSrc, ""));
+ video.srcObject=null;
+ }
+
+ function playingNothing()
+ {
+ test.step(() => assert_equals(video.srcObject, null));
+ test.step(() => assert_equals(video.currentSrc, ""));
+ test.done();
+ }
+
+ test.step(startTest);
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698