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

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: Created 3 years, 11 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 test.step_func_done(function(event) {
12 assert_true(event.data.size > 0, 'Recorded data size should be > 0');
13 });
14 recorder.start(0);
15
16 var ctx = canvas.getContext('2d');
17 ctx.fillStyle = 'green';
18 ctx.fillRect(0, 0, canvas.width, canvas.height);
19 }, "Verify that drawing to a 2D canvas that is not attached to the DOM dispatche s a frame to an attached MediaRecorder.");
20
21 async_test(t => {
22 var canvas = document.createElement('canvas');
23
24 var recorder = new MediaRecorder(canvas.captureStream());
25 recorder.ondataavailable = function() {
26 test.step_func_done(function(event) {
27 assert_true(event.data.size > 0, 'Recorded data size should be > 0');
28 });
29 recorder.start(0);
30
31 var gl = canvas.getContext('webgl');
32 gl.clearColor(0, 1, 0, 1);
33 gl.clear(gl.COLOR_BUFFER_BIT);
34 }, "Verify that drawing to a webgl canvas that is not attached to the DOM dispat ches a frame to an attached MediaRecorder.");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698