OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description("Test onactive/oninactive callback."); | 10 description("Test onactive/oninactive callback."); |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 var stream; | 26 var stream; |
27 | 27 |
28 function streamActive() { | 28 function streamActive() { |
29 testPassed('streamActive was called.'); | 29 testPassed('streamActive was called.'); |
30 shouldBeTrue('stream.active'); | 30 shouldBeTrue('stream.active'); |
31 finishJSTest(); | 31 finishJSTest(); |
32 } | 32 } |
33 | 33 |
34 function gotStream2(s) { | 34 function gotStream2(s) { |
35 stream = new webkitMediaStream(); | 35 stream = new MediaStream(); |
36 shouldBeFalse('stream.active'); | 36 shouldBeFalse('stream.active'); |
37 stream.onactive = streamActive; | 37 stream.onactive = streamActive; |
38 stream.addTrack(s.getAudioTracks()[0]); | 38 stream.addTrack(s.getAudioTracks()[0]); |
39 } | 39 } |
40 | 40 |
41 function streamInactive() { | 41 function streamInactive() { |
42 testPassed('streamInactive was called.'); | 42 testPassed('streamInactive was called.'); |
43 shouldBeFalse('stream.active'); | 43 shouldBeFalse('stream.active'); |
44 | 44 |
45 getUserMedia({audio:true, video:true}, gotStream2); | 45 getUserMedia({audio:true, video:true}, gotStream2); |
46 } | 46 } |
47 | 47 |
48 function gotStream(s) { | 48 function gotStream(s) { |
49 stream = s; | 49 stream = s; |
50 shouldBeTrue('stream.active'); | 50 shouldBeTrue('stream.active'); |
51 stream.oninactive = streamInactive; | 51 stream.oninactive = streamInactive; |
52 shouldBe('stream.getAudioTracks().length', '1'); | 52 shouldBe('stream.getAudioTracks().length', '1'); |
53 shouldBe('stream.getVideoTracks().length', '1'); | 53 shouldBe('stream.getVideoTracks().length', '1'); |
54 stream.removeTrack(stream.getAudioTracks()[0]); | 54 stream.removeTrack(stream.getAudioTracks()[0]); |
55 stream.removeTrack(stream.getVideoTracks()[0]); | 55 stream.removeTrack(stream.getVideoTracks()[0]); |
56 } | 56 } |
57 | 57 |
58 getUserMedia({audio:true, video:true}, gotStream); | 58 getUserMedia({audio:true, video:true}, gotStream); |
59 | 59 |
60 window.jsTestIsAsync = true; | 60 window.jsTestIsAsync = true; |
61 window.successfullyParsed = true; | 61 window.successfullyParsed = true; |
62 </script> | 62 </script> |
63 </body> | 63 </body> |
64 </html> | 64 </html> |
OLD | NEW |