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

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: fix condition 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-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..27b3445d8308053d7da797d8edcaef84f6e3e794
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/video-srcobject-mediastream-src-file.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <video id="testVideo" autoplay="autoplay"></video>
+ <div id="log"></div>
philipj_slow 2016/04/06 11:58:41 You typically don't need to include this, it'll be
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ <p>Test that setting the HTMLMediaElement.srcObject overrides setting the
+ src attribute and if the srcObject is set to null, media is reloaded from
+ the src 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");
philipj_slow 2016/04/06 11:58:41 You can skip the id and just use document.querySel
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ var trackevent = "playing";
philipj_slow 2016/04/06 11:58:41 Just inline "playing" everywhere?
Guido Urdaneta 2016/04/06 16:34:54 Done. Using onplaying instead.
+
+ function startTest()
+ {
+ test.step(() => assert_idl_attribute(video, "srcObject"));
+ video.addEventListener(trackevent, playingFileFromSrc)
+ video.src = getVideoURI("test");
philipj_slow 2016/04/06 11:58:41 It'd be more clear if you set src and srcObject at
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ }
+
+ function playingFileFromSrc()
+ {
+ video.removeEventListener(trackevent, playingFileFromSrc);
+ video.addEventListener(trackevent, playingSrcObject);
+ test.step(_ => assert_equals(video.srcObject, null));
+ test.step(_ => assert_equals(video.currentSrc, video.src));
+ navigator.webkitGetUserMedia(
+ {video:true},
+ stream => video.srcObject = stream,
+ _ => test.step(() => assert_unreached("Did not get mediastream")));
+ }
+
+ function playingSrcObject()
+ {
+ video.removeEventListener(trackevent, playingSrcObject)
+ video.addEventListener(trackevent, playingFileAfterSrcObjectRemoved)
+ 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 playingFileAfterSrcObjectRemoved()
+ {
+ test.step(() => assert_equals(video.srcObject, null));
+ test.step(() => assert_equals(video.currentSrc, video.src));
+ test.done();
+ }
+
+ test.step(startTest);
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698