OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>MediaStream constructor algorithm</title> | 4 <title>MediaStream constructor algorithm</title> |
5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/> | 5 <link rel="author" title="Dominique Hazael-Massieux" href="mailto:dom@w3.org"/> |
6 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
idl-def-MediaStream"> | 6 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
idl-def-MediaStream"> |
7 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStream-id"> | 7 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStream-id"> |
8 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
mediastream"> | 8 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
mediastream"> |
9 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
event-mediastreamtrack-ended"> | 9 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
event-mediastreamtrack-ended"> |
10 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStreamTrack-stop-void"> | 10 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStreamTrack-stop-void"> |
11 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStreamTrack-clone-MediaStreamTrack"> | 11 <link rel="help" href="http://w3c.github.io/mediacapture-main/getusermedia.html#
widl-MediaStreamTrack-clone-MediaStreamTrack"> |
12 </head> | 12 </head> |
13 <body> | 13 <body> |
14 <p class="instructions" style="display:none">When prompted, accept to share your
video and audio stream.</p> | 14 <p class="instructions" style="display:none">When prompted, accept to share your
video and audio stream.</p> |
15 <h1 class="instructions" style="display:none">Description</h1> | 15 <h1 class="instructions" style="display:none">Description</h1> |
16 <p class="instructions" style="display:none">This test checks that the MediaStre
am constructor | 16 <p class="instructions" style="display:none">This test checks that the MediaStre
am constructor |
17 follows the algorithm set in the spec.</p> | 17 follows the algorithm set in the spec.</p> |
18 | 18 |
19 <div id='log'></div> | 19 <div id='log'></div> |
20 <script src=../../../../../resources/testharness.js></script> | 20 <script src=../../../resources/testharness.js></script> |
21 <script src=../../../../../resources/testharnessreport.js></script> | 21 <script src=../../../resources/testharnessreport.js></script> |
22 <script src="../../../../../resources/vendor-prefix.js" data-prefixed-objects='[
{"ancestors":["navigator"], "name":"getUserMedia"},{"ancestors":["window"], "nam
e":"MediaStream"}]'></script> | 22 <script src="../../../resources/vendor-prefix.js" data-prefixed-objects='[{"ance
stors":["navigator"], "name":"getUserMedia"},{"ancestors":["window"], "name":"Me
diaStream"}]'></script> |
23 <script> | 23 <script> |
24 var t = async_test("Tests that a MediaStream constructor follows the algorithm s
et in the spec", {timeout: 10000}); | 24 var t = async_test("Tests that a MediaStream constructor follows the algorithm s
et in the spec", {timeout: 10000}); |
25 t.step(function() { | 25 t.step(function() { |
26 navigator.getUserMedia({video: true, audio:true}, t.step_func(function (stream
) { | 26 navigator.getUserMedia({video: true, audio:true}, t.step_func(function (stream
) { |
27 var stream1 = new MediaStream(); | 27 var stream1 = new MediaStream(); |
28 assert_not_equals(stream.id, stream1.id, "Two different MediaStreams have di
fferent ids"); | 28 assert_not_equals(stream.id, stream1.id, "Two different MediaStreams have di
fferent ids"); |
29 var stream2 = new MediaStream(stream); | 29 var stream2 = new MediaStream(stream); |
30 assert_not_equals(stream.id, stream2.id, "A MediaStream constructed from ano
ther have different ids"); | 30 assert_not_equals(stream.id, stream2.id, "A MediaStream constructed from ano
ther have different ids"); |
31 var audioTrack1 = stream.getAudioTracks()[0]; | 31 var audioTrack1 = stream.getAudioTracks()[0]; |
32 var videoTrack = stream.getVideoTracks()[0]; | 32 var videoTrack = stream.getVideoTracks()[0]; |
(...skipping 10 matching lines...) Expand all Loading... |
43 var stream5 = new MediaStream([audioTrack2]); | 43 var stream5 = new MediaStream([audioTrack2]); |
44 assert_false(stream5.active, "a MediaStream created using the MediaStream()
constructor whose arguments are lists of MediaStreamTrack objects that are all
ended, the MediaStream object MUST be created with its active attribute set to f
alse"); | 44 assert_false(stream5.active, "a MediaStream created using the MediaStream()
constructor whose arguments are lists of MediaStreamTrack objects that are all
ended, the MediaStream object MUST be created with its active attribute set to f
alse"); |
45 t.done(); | 45 t.done(); |
46 }), false); | 46 }), false); |
47 audioTrack2.stop(); | 47 audioTrack2.stop(); |
48 }), function(error) {}); | 48 }), function(error) {}); |
49 }); | 49 }); |
50 </script> | 50 </script> |
51 </body> | 51 </body> |
52 </html> | 52 </html> |
OLD | NEW |