| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 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 <canvas id="canvas_source"></canvas> | 9 <canvas id="canvas_source"></canvas> |
| 10 <script> | 10 <script> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 function recordMediaStream() { | 40 function recordMediaStream() { |
| 41 shouldBe('stream.getVideoTracks().length', '1'); | 41 shouldBe('stream.getVideoTracks().length', '1'); |
| 42 track = stream.getVideoTracks()[0]; | 42 track = stream.getVideoTracks()[0]; |
| 43 shouldBeEqualToString('track.readyState', 'live'); | 43 shouldBeEqualToString('track.readyState', 'live'); |
| 44 | 44 |
| 45 recorder = new MediaRecorder(stream); | 45 recorder = new MediaRecorder(stream); |
| 46 recorder.ondataavailable = onRecorderDataAvailable; | 46 recorder.ondataavailable = onRecorderDataAvailable; |
| 47 recorder.onError = onRecorderDataAvailable; | 47 recorder.onError = onRecorderDataAvailable; |
| 48 recorder.start(); | 48 recorder.start(0); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 drawToCanvas(canvas); | 51 drawToCanvas(canvas); |
| 52 try { | 52 try { |
| 53 stream = canvas.captureStream(0); | 53 stream = canvas.captureStream(0); |
| 54 testPassed('Got a stream from canvas.'); | 54 testPassed('Got a stream from canvas.'); |
| 55 } catch (e) { | 55 } catch (e) { |
| 56 testFailed('Exception calling captureStream(): ' + e); | 56 testFailed('Exception calling captureStream(): ' + e); |
| 57 finishJSTest(); | 57 finishJSTest(); |
| 58 } | 58 } |
| 59 if (stream) { | 59 if (stream) { |
| 60 recordMediaStream(); | 60 recordMediaStream(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 </script> | 63 </script> |
| 64 </body> | 64 </body> |
| 65 </html> | 65 </html> |
| OLD | NEW |