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

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: philipj's comments Created 4 years, 8 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..a7be482b00f21c53677f4aa122c5d01219406fdd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<title>Test assignment of a MediaStream via the srcObject attribute.</title>
+<video autoplay></video>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+
+ async_test(test => {
+ var video = document.querySelector("video")
+ assert_idl_attribute(video, "srcObject");
+ assert_equals(video.srcObject, null);
+ assert_equals(video.currentSrc, "");
+ navigator.webkitGetUserMedia(
+ {video:true},
+ test.step_func(stream => {
+ video.addEventListener("playing", test.step_func(playingSrcObject));
+ video.srcObject = stream;
+ }),
+ test.unreached_func("Did not get mediastream"));
+
+ function playingSrcObject()
+ {
+ video.addEventListener("emptied", test.step_func_done(_ => {
+ assert_equals(video.srcObject, null);
+ assert_equals(video.currentSrc, "");
+ }));
+ assert_not_equals(video.srcObject, null);
+ assert_class_string(video.srcObject, "MediaStream");
+ assert_equals(video.currentSrc, "");
+ video.srcObject = null;
+ }
+ })
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698