OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> | |
5 <script src="../js/resources/js-test-pre.js"></script> | |
6 </head> | |
7 <body> | |
8 <p id="description"></p> | |
9 <div id="console"></div> | |
10 <script> | |
11 description("Tests MediaStreamTrack::getSourceInfos."); | |
12 | |
13 var sources = null; | |
14 var previousId; | |
15 | |
16 function error() { | |
17 testFailed('Stream generation failed.'); | |
18 finishJSTest(); | |
19 } | |
20 | |
21 function getUserMedia(constraints, callback) { | |
22 try { | |
23 navigator.webkitGetUserMedia(constraints, callback, error); | |
24 } catch (e) { | |
25 testFailed('webkitGetUserMedia threw exception :' + e); | |
26 finishJSTest(); | |
27 } | |
28 } | |
29 | |
30 function gotStream(s) { | |
31 shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();'); | |
32 shouldBeTrue('sources.length > 0'); | |
33 shouldBeTrue('sources[0].id === previousId'); | |
34 shouldBeTrue('sources[0].label.length > 0'); | |
35 finishJSTest(); | |
36 } | |
37 | |
38 shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();'); | |
39 shouldBeTrue('sources.length > 0'); | |
40 previousId = sources[0].id; | |
41 | |
42 getUserMedia({audio:true, video:true}, gotStream); | |
43 | |
44 window.jsTestIsAsync = true; | |
45 window.successfullyParsed = true; | |
46 </script> | |
47 <script src="../js/resources/js-test-post.js"></script> | |
48 </body> | |
49 </html> | |
OLD | NEW |