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

Side by Side 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, 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 that setting the HTMLMediaElement.srcObject overrides setting the
7 src attribute and if the srcObject is set to null, media is reloaded from
8 the src attribute.</p>
9 <script src="../resources/testharness.js"></script>
10 <script src="../resources/testharnessreport.js"></script>
11 <script src="./w3c-media-utils.js"></script>
12 <script>
13 var test = async_test("srcObject test");
14 var video = document.getElementById("testVideo");
15 var trackevent = "playing";
16
17 function startTest()
18 {
19 test.step(() => assert_idl_attribute(video, "srcObject"));
20 video.addEventListener(trackevent, playingFileOnce)
21 video.src = getVideoURI("test");
22 }
23
24 function playingFileOnce()
hta - Chromium 2016/04/01 15:08:15 Style suggestion: name function playingFileFromSrc
Guido Urdaneta 2016/04/02 18:32:51 Done.
25 {
26 video.removeEventListener(trackevent, playingFileOnce);
27 video.addEventListener(trackevent, playingSrcObject);
28 test.step(_ => assert_equals(video.srcObject, null));
29 test.step(_ => assert_equals(video.currentSrc, video.src));
30 navigator.webkitGetUserMedia(
31 {video:true},
32 stream => video.srcObject = stream,
33 _ => test.step(() => assert_unreached("Did not get mediastream") ));
34 }
35
36 function playingSrcObject()
37 {
38 video.removeEventListener(trackevent, playingSrcObject)
39 video.addEventListener(trackevent, playingFileTwice)
40 test.step(() => assert_not_equals(video.srcObject, null));
41 test.step(() => assert_class_string(video.srcObject, "MediaStream")) ;
42 test.step(() => assert_equals(video.currentSrc, ""));
43 video.srcObject=null;
hta - Chromium 2016/04/01 15:08:15 Nit: Spaces around operator
Guido Urdaneta 2016/04/02 18:32:51 Done.
44 }
45
46 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.
47 {
48 test.step(() => assert_equals(video.srcObject, null));
49 test.step(() => assert_equals(video.currentSrc, video.src));
50 test.done();
51 }
52
53 test.step(startTest);
54 </script>
55 </body>
56 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698