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

Unified Diff: third_party/WebKit/LayoutTests/media/video-srcobject-mediastream-src-file.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-src-file.html
diff --git a/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream-src-file.html b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream-src-file.html
new file mode 100644
index 0000000000000000000000000000000000000000..e17eec4dde3213646f917b64f538559d6e807201
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream-src-file.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<title>Test that setting the srcObject attribute overrides the src attribute and if the srcObject is set to null, media is reloaded from the src attribute.</title>
+<video autoplay></video>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="./w3c-media-utils.js"></script>
+<script>
+
+ async_test(test => {
+ var video = document.querySelector("video");
+ assert_idl_attribute(video, "srcObject");
+ assert_equals(video.srcObject, null);
+ video.src = getVideoURI("test");
+ navigator.webkitGetUserMedia(
+ {video:true},
+ test.step_func(stream => {
+ video.onplaying = test.step_func(playingSrcObject);
+ video.srcObject = stream;
+ }),
+ test.unreached_func("Did not get mediastream"));
+
+ function playingSrcObject()
+ {
+ assert_not_equals(video.srcObject, null);
+ assert_class_string(video.srcObject, "MediaStream");
+ assert_equals(video.currentSrc, "");
+ video.onplaying = test.step_func_done(playingFileAfterSrcObjectRemoved);
+ video.srcObject = null;
+ }
+
+ function playingFileAfterSrcObjectRemoved()
+ {
+ assert_equals(video.srcObject, null);
+ assert_equals(video.currentSrc, video.src);
+ }
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698