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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/imagecapture/ImageCapture-grabFrame.html

Issue 1899403002: MediaStream Image Capture (2): Platform::ImageCaptureFrameGrabber and grabFrame() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: emircan@ comments and using SkImage (ref counted) instead of SkBitmap (moveable-non-copyable) throu… Created 4 years, 7 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 <body>
5 <canvas id='canvas0' width=10 height=10/>
6 </body>
7 <script>
8
9 // This test verifies that ImageCapture can grabFrame()s.
10
11 var test = async_test(function() {
12 var canvas = document.getElementById('canvas0');
13 // We need to paint something on the canvas to force it to create a context.
Justin Novosad 2016/04/27 15:03:17 This comment smells like there is an underlying bu
mcasas 2016/04/27 17:48:18 What I meant is that canvas.captureStream() in l.
14 canvas.getContext("2d").fillRect(0, 0, 1, 1);
15
16 var stream = canvas.captureStream();
17 var capturer = new ImageCapture(stream.getVideoTracks()[0]);
18
19 capturer.grabFrame()
20 .then(bitmap => {
21 assert_equals(document.getElementById('canvas0').width, bitmap.width);
22 assert_equals(document.getElementById('canvas0').height, bitmap.height);
Justin Novosad 2016/04/27 15:03:17 Test is incomplete. You should verify that the pix
mcasas 2016/04/27 17:48:18 Done.
23 this.done();
24 })
25 .catch(error => {
26 assert_unreached('Error during grabFrame(): '+ error);
27 });
28 }, 'exercises the ImageCapture API creation and grabFrame().');
29
30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698