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

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: philipj's comments 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 <title>Test that setting the srcObject attribute overrides the src attribute and if the srcObject is set to null, media is reloaded from the src attribute.</tit le>
3 <video autoplay></video>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script src="./w3c-media-utils.js"></script>
7 <script>
8
9 async_test(test => {
10 var video = document.querySelector("video");
11 assert_idl_attribute(video, "srcObject");
12 assert_equals(video.srcObject, null);
13 video.src = getVideoURI("test");
14 navigator.webkitGetUserMedia(
15 {video:true},
16 test.step_func(stream => {
17 video.onplaying = test.step_func(playingSrcObject);
18 video.srcObject = stream;
19 }),
20 test.unreached_func("Did not get mediastream"));
21
22 function playingSrcObject()
23 {
24 assert_not_equals(video.srcObject, null);
25 assert_class_string(video.srcObject, "MediaStream");
26 assert_equals(video.currentSrc, "");
27 video.onplaying = test.step_func_done(playingFileAfterSrcObjectRemov ed);
28 video.srcObject = null;
29 }
30
31 function playingFileAfterSrcObjectRemoved()
32 {
33 assert_equals(video.srcObject, null);
34 assert_equals(video.currentSrc, video.src);
35 }
36 });
37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698