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

Side by Side 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: rebase + tommi's comment 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <body>
4 <video id="testVideo" autoplay="autoplay"></video>
5 <div id="log"></div>
6 <p>Test assigment of a mediastream via the srcObject attribute.</p>
7 <script src="../resources/testharness.js"></script>
8 <script src="../resources/testharnessreport.js"></script>
9 <script src="./w3c-media-utils.js"></script>
10 <script>
11 var test = async_test("srcObject test");
12 var video = document.getElementById("testVideo");
13
14 function startTest()
15 {
16 test.step(() => assert_idl_attribute(video, "srcObject"));
17 video.addEventListener("playing", playingSrcObject);
18 test.step(_ => assert_equals(video.srcObject, null));
19 test.step(_ => assert_equals(video.currentSrc, ""));
20 navigator.webkitGetUserMedia(
21 {video:true},
22 stream => video.srcObject = stream,
23 _ => test.step(() => assert_unreached("Did not get mediastream") ));
24 }
25
26 function playingSrcObject()
27 {
28 video.removeEventListener("playing", playingSrcObject)
29 video.addEventListener("emptied", playingNothing)
30 test.step(() => assert_not_equals(video.srcObject, null));
31 test.step(() => assert_class_string(video.srcObject, "MediaStream")) ;
32 test.step(() => assert_equals(video.currentSrc, ""));
33 video.srcObject=null;
34 }
35
36 function playingNothing()
37 {
38 test.step(() => assert_equals(video.srcObject, null));
39 test.step(() => assert_equals(video.currentSrc, ""));
40 test.done();
41 }
42
43 test.step(startTest);
44 </script>
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698