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

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: 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.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>
philipj_slow 2016/04/06 11:58:42 Nit: The autoplay attribute doesn't need any speci
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ <div id="log"></div>
+ <p>Test assigment of a mediastream via the srcObject attribute.</p>
philipj_slow 2016/04/06 11:58:42 Can you put this inside <title> at the top? This w
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ <script src="../resources/testharness.js"></script>
+ <script src="../resources/testharnessreport.js"></script>
+ <script src="./w3c-media-utils.js"></script>
philipj_slow 2016/04/06 11:58:41 Doesn't look like you're using anything from w3c-m
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ <script>
+ var test = async_test("srcObject test");
+ var video = document.getElementById("testVideo");
+
+ function startTest()
+ {
+ test.step(() => assert_idl_attribute(video, "srcObject"));
philipj_slow 2016/04/06 11:58:42 You shouldn't need to wrap any individual steps li
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ video.addEventListener("playing", playingSrcObject);
philipj_slow 2016/04/06 11:58:41 Here you'll need test.step_func(playingSrcObject).
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ test.step(_ => assert_equals(video.srcObject, null));
+ test.step(_ => assert_equals(video.currentSrc, ""));
+ navigator.webkitGetUserMedia(
+ {video:true},
+ stream => video.srcObject = stream,
philipj_slow 2016/04/06 11:58:42 The sequence of events could be a bit clearer if y
Guido Urdaneta 2016/04/06 16:34:54 Done, but kept the autoplay. With an explicit call
philipj_slow 2016/04/07 15:38:11 Do you get a rejected promise even if you call pla
+ _ => test.step(() => assert_unreached("Did not get mediastream")));
philipj_slow 2016/04/06 11:58:41 This can be test.unreached_func("Did not get Media
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ }
+
+ function playingSrcObject()
+ {
+ video.removeEventListener("playing", playingSrcObject)
philipj_slow 2016/04/06 11:58:42 Is this needed? If it is, then using the onplaying
Guido Urdaneta 2016/04/06 16:34:54 Done. Not needed.
+ video.addEventListener("emptied", playingNothing)
philipj_slow 2016/04/06 11:58:41 This is an oddly named callback. If you don't enjo
Guido Urdaneta 2016/04/06 16:34:54 Done. What would have been a good name? :)
philipj_slow 2016/04/07 15:38:11 Maybe "emptied"? Just "playing" for the current fu
+ 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;
philipj_slow 2016/04/06 11:58:42 Needs more whitespace.
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ }
+
+ function playingNothing()
+ {
+ test.step(() => assert_equals(video.srcObject, null));
+ test.step(() => assert_equals(video.currentSrc, ""));
+ test.done();
philipj_slow 2016/04/06 11:58:42 When this is wrapped instead, you can use test.ste
Guido Urdaneta 2016/04/06 16:34:54 Done.
+ }
+
+ test.step(startTest);
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698