OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src =../../resources/testharness.js></script> |
| 3 <script src =../../resources/testharnessreport.js></script> |
| 4 <script> |
| 5 |
| 6 async_test(t => { |
| 7 var canvas = document.createElement('canvas'); |
| 8 |
| 9 var recorder = new MediaRecorder(canvas.captureStream()); |
| 10 recorder.ondataavailable = function() { |
| 11 t.step_func_done(function() { |
| 12 assert_true(event.data.size > 0, 'Recorded data size should be > 0'); |
| 13 })(); |
| 14 recorder.stop(); |
| 15 } |
| 16 recorder.start(0); |
| 17 |
| 18 var ctx = canvas.getContext('2d'); |
| 19 ctx.fillStyle = 'green'; |
| 20 ctx.fillRect(0, 0, canvas.width, canvas.height); |
| 21 }, "Verify that drawing to a 2D canvas that is not attached to the DOM dispatche
s a frame to an attached MediaRecorder." ); |
| 22 |
| 23 async_test(t => { |
| 24 var canvas = document.createElement('canvas'); |
| 25 |
| 26 var recorder = new MediaRecorder(canvas.captureStream()); |
| 27 recorder.ondataavailable = function() { |
| 28 t.step_func_done(function() { |
| 29 assert_true(event.data.size > 0, 'Recorded data size should be > 0'); |
| 30 })(); |
| 31 recorder.stop(); |
| 32 } |
| 33 recorder.start(0); |
| 34 |
| 35 var gl = canvas.getContext('webgl'); |
| 36 gl.clearColor(0, 1, 0, 1); |
| 37 gl.clear(gl.COLOR_BUFFER_BIT); |
| 38 }, "Verify that drawing to a webgl canvas that is not attached to the DOM dispat
ches a frame to an attached MediaRecorder." ); |
| 39 </script> |
OLD | NEW |