Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/CanvasCaptureMediaStream-capture-out-of-DOM-element.html

Issue 2653933003: Make stream captures work on canvases that are not in the DOM. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698