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

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: 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-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..6e58bad66ad544f1c2127c7483ab4305e5501342
--- /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>
+ <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");
+ var trackevent = "playing";
+
+ function startTest()
+ {
+ test.step(() => assert_idl_attribute(video, "srcObject"));
+ video.addEventListener(trackevent, playingFileOnce)
+ video.src = getVideoURI("test");
+ }
+
+ function playingFileOnce()
hta - Chromium 2016/04/01 15:08:15 Style suggestion: name function playingFileFromSrc
Guido Urdaneta 2016/04/02 18:32:51 Done.
+ {
+ video.removeEventListener(trackevent, playingFileOnce);
+ 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, playingFileTwice)
+ 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;
hta - Chromium 2016/04/01 15:08:15 Nit: Spaces around operator
Guido Urdaneta 2016/04/02 18:32:51 Done.
+ }
+
+ function playingFileTwice()
hta - Chromium 2016/04/01 15:08:15 Style suggestion: Name function playing FileAfterS
Guido Urdaneta 2016/04/02 18:32:51 Done.
+ {
+ 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