| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Test that mediastreamtrack are properly ended</title> | |
| 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#
mediastreamtrack"> | |
| 7 </head> | |
| 8 <body> | |
| 9 <p class="instructions">When prompted, accept to share your video and audio | |
| 10 stream, and then revoke that permission.</p> | |
| 11 <h1 class="instructions">Description</h1> | |
| 12 <p class="instructions">This test checks that the video and audio tracks of | |
| 13 MediaStream object returned by the success callback in getUserMedia are | |
| 14 correctly set into inactive state when permission is revoked.</p> | |
| 15 | |
| 16 <div id='log'></div> | |
| 17 <script src=/resources/testharness.js></script> | |
| 18 <script src=/resources/testharnessreport.js></script> | |
| 19 <script src="/common/vendor-prefix.js" data-prefixed-objects='[{"ancestors":["na
vigator"], "name":"getUserMedia"}]'></script> | |
| 20 <script> | |
| 21 var t = async_test("Tests that the video MediaStreamTrack objects are properly e
nded on permission revocation", {timeout: 20000}); // longer timeout since requi
res user interaction | |
| 22 t.step(function () { | |
| 23 navigator.getUserMedia({audio: true,video: true}, t.step_func(function (stream
) { | |
| 24 var vidTrack = stream.getVideoTracks()[0]; | |
| 25 assert_equals(vidTrack.readyState, "live", "The video track object is in liv
e state"); | |
| 26 var audTrack = stream.getAudioTracks()[0]; | |
| 27 assert_equals(audTrack.readyState, "live", "The audio track object is in liv
e state"); | |
| 28 vidTrack.onended = t.step_func(function () { | |
| 29 assert_equals(vidTrack.readyState, "ended", "Video track has been ended
as expected"); | |
| 30 assert_equals(audTrack.readyState, "ended", "Audio track has been ended
as expected"); | |
| 31 assert_false(stream.active, "MediaStream has been inactive as expected")
; | |
| 32 t.done(); | |
| 33 }); | |
| 34 }), function (error) {} | |
| 35 ); | |
| 36 }); | |
| 37 </script> | |
| 38 </body> | |
| 39 </html> | |
| OLD | NEW |