Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d8133b95f0077b22d15782d4170581b04b30385 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html |
| @@ -0,0 +1,37 @@ |
| +<!DOCTYPE html> |
| +<script src =../../resources/testharness.js></script> |
| +<script src =../../resources/testharnessreport.js></script> |
| +<script> |
| + |
| +async_test(t => { |
| + var canvas = document.createElement('canvas'); |
| + |
| + var recorder = new MediaRecorder(canvas.captureStream()); |
| + recorder.ondataavailable = function() { |
| + t.step_func_done(function() { |
| + assert_true(event.data.size > 0, 'Recorded data size should be > 0'); |
| + })(); |
| + } |
| + 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.
|
| + |
| + var ctx = canvas.getContext('2d'); |
| + ctx.fillStyle = 'green'; |
| + ctx.fillRect(0, 0, canvas.width, canvas.height); |
| +}, "Verify that drawing to a 2D canvas that is not attached to the DOM dispatches a frame to an attached MediaRecorder." ); |
| + |
| +async_test(t => { |
| + var canvas = document.createElement('canvas'); |
| + |
| + var recorder = new MediaRecorder(canvas.captureStream()); |
| + recorder.ondataavailable = function() { |
| + t.step_func_done(function() { |
| + assert_true(event.data.size > 0, 'Recorded data size should be > 0'); |
| + })(); |
| + } |
| + recorder.start(0); |
| + |
| + var gl = canvas.getContext('webgl'); |
| + gl.clearColor(0, 1, 0, 1); |
| + gl.clear(gl.COLOR_BUFFER_BIT); |
| +}, "Verify that drawing to a webgl canvas that is not attached to the DOM dispatches a frame to an attached MediaRecorder." ); |
| +</script> |