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 } | |
15 recorder.start(0); | |
xlai (Olivia)
2017/02/08 17:58:40
no need to call recorder.stop()?
Justin Novosad
2017/02/08 18:43:11
Done.
| |
16 | |
17 var ctx = canvas.getContext('2d'); | |
18 ctx.fillStyle = 'green'; | |
19 ctx.fillRect(0, 0, canvas.width, canvas.height); | |
20 }, "Verify that drawing to a 2D canvas that is not attached to the DOM dispatche s a frame to an attached MediaRecorder." ); | |
21 | |
22 async_test(t => { | |
23 var canvas = document.createElement('canvas'); | |
24 | |
25 var recorder = new MediaRecorder(canvas.captureStream()); | |
26 recorder.ondataavailable = function() { | |
27 t.step_func_done(function() { | |
28 assert_true(event.data.size > 0, 'Recorded data size should be > 0'); | |
29 })(); | |
30 } | |
31 recorder.start(0); | |
32 | |
33 var gl = canvas.getContext('webgl'); | |
34 gl.clearColor(0, 1, 0, 1); | |
35 gl.clear(gl.COLOR_BUFFER_BIT); | |
36 }, "Verify that drawing to a webgl canvas that is not attached to the DOM dispat ches a frame to an attached MediaRecorder." ); | |
37 </script> | |
OLD | NEW |