| 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     s.getAudioTracks()[0].stop(); | 
|  | 98     s.getVideoTracks()[0].stop(); | 
| 98 } | 99 } | 
| 99 | 100 | 
| 100 function verifyStream(s, numAudioTracks, numVideoTracks) { | 101 function verifyStream(s, numAudioTracks, numVideoTracks) { | 
| 101     newStream = s; | 102     newStream = s; | 
| 102     nAudio = numAudioTracks; | 103     nAudio = numAudioTracks; | 
| 103     nVideo = numVideoTracks; | 104     nVideo = numVideoTracks; | 
| 104 | 105 | 
| 105     testPassed('Stream constructed'); | 106     testPassed('Stream constructed'); | 
| 106     shouldBeNonNull(newStream); | 107     shouldBeNonNull(newStream); | 
| 107     shouldBeDefined(newStream); | 108     shouldBeDefined(newStream); | 
| 108     shouldBe("newStream.constructor.name", "'MediaStream'"); | 109     shouldBe("newStream.constructor.name", "'MediaStream'"); | 
| 109     shouldBe('newStream.getAudioTracks().length', 'nAudio'); | 110     shouldBe('newStream.getAudioTracks().length', 'nAudio'); | 
| 110     shouldBe('newStream.getVideoTracks().length', 'nVideo'); | 111     shouldBe('newStream.getVideoTracks().length', 'nVideo'); | 
| 111 | 112 | 
| 112     if (!nAudio && !nVideo) | 113     if (!nAudio && !nVideo) | 
| 113         shouldBe('newStream.active', 'false'); | 114         shouldBe('newStream.active', 'false'); | 
| 114     else | 115     else | 
| 115         shouldBe('newStream.active', 'true'); | 116         shouldBe('newStream.active', 'true'); | 
| 116 | 117 | 
| 117     shouldBeTrue('checkIdAttribute(newStream.id)'); | 118     shouldBeTrue('checkIdAttribute(newStream.id)'); | 
| 118 } | 119 } | 
| 119 | 120 | 
| 120 getUserMedia({video:true, audio:true}, gotStream); | 121 getUserMedia({video:true, audio:true}, gotStream); | 
| 121 | 122 | 
| 122 window.jsTestIsAsync = true; | 123 window.jsTestIsAsync = true; | 
| 123 window.successfullyParsed = true; | 124 window.successfullyParsed = true; | 
| 124 </script> | 125 </script> | 
| 125 </body> | 126 </body> | 
| 126 </html> | 127 </html> | 
| OLD | NEW | 
|---|