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("Tests webkitMediaStream."); | 10 description("Tests webkitMediaStream."); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 | 87 |
88 s.oninactive = function () { | 88 s.oninactive = function () { |
89 verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 0, 0); | 89 verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 0, 0); |
90 verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 0); | 90 verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 0); |
91 verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTra cks()[0]]), 0, 0); | 91 verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTra cks()[0]]), 0, 0); |
92 verifyStream(new webkitMediaStream(s), 0, 0); | 92 verifyStream(new webkitMediaStream(s), 0, 0); |
93 | 93 |
94 finishJSTest(); | 94 finishJSTest(); |
95 }; | 95 }; |
96 | 96 |
97 s.stop(); | 97 for (var i = 0; i < s.getAudioTracks().length; i++) |
philipj_slow
2015/08/27 14:34:54
Ditto.
shiva.jm
2015/08/28 04:40:23
Done.
| |
98 s.getAudioTracks()[i].stop(); | |
99 | |
100 for (var i = 0; i < s.getVideoTracks().length; i++) | |
101 s.getVideoTracks()[i].stop(); | |
98 } | 102 } |
99 | 103 |
100 function verifyStream(s, numAudioTracks, numVideoTracks) { | 104 function verifyStream(s, numAudioTracks, numVideoTracks) { |
101 newStream = s; | 105 newStream = s; |
102 nAudio = numAudioTracks; | 106 nAudio = numAudioTracks; |
103 nVideo = numVideoTracks; | 107 nVideo = numVideoTracks; |
104 | 108 |
105 testPassed('Stream constructed'); | 109 testPassed('Stream constructed'); |
106 shouldBeNonNull(newStream); | 110 shouldBeNonNull(newStream); |
107 shouldBeDefined(newStream); | 111 shouldBeDefined(newStream); |
108 shouldBe("newStream.constructor.name", "'MediaStream'"); | 112 shouldBe("newStream.constructor.name", "'MediaStream'"); |
109 shouldBe('newStream.getAudioTracks().length', 'nAudio'); | 113 shouldBe('newStream.getAudioTracks().length', 'nAudio'); |
110 shouldBe('newStream.getVideoTracks().length', 'nVideo'); | 114 shouldBe('newStream.getVideoTracks().length', 'nVideo'); |
111 | 115 |
112 if (!nAudio && !nVideo) | 116 if (!nAudio && !nVideo) |
113 shouldBe('newStream.active', 'false'); | 117 shouldBe('newStream.active', 'false'); |
114 else | 118 else |
115 shouldBe('newStream.active', 'true'); | 119 shouldBe('newStream.active', 'true'); |
116 | 120 |
117 shouldBeTrue('checkIdAttribute(newStream.id)'); | 121 shouldBeTrue('checkIdAttribute(newStream.id)'); |
118 } | 122 } |
119 | 123 |
120 getUserMedia({video:true, audio:true}, gotStream); | 124 getUserMedia({video:true, audio:true}, gotStream); |
121 | 125 |
122 window.jsTestIsAsync = true; | 126 window.jsTestIsAsync = true; |
123 window.successfullyParsed = true; | 127 window.successfullyParsed = true; |
124 </script> | 128 </script> |
125 </body> | 129 </body> |
126 </html> | 130 </html> |
OLD | NEW |