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

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: fix test + review comments 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 }
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698