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

Side by Side Diff: third_party/WebKit/LayoutTests/imagecapture/takephoto.html

Issue 1966083003: ImageCapture: takePhoto() mock LayoutTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: offline reillyg@ comments on mock-imagecapture.js 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
« no previous file with comments | « third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <body>
3 <canvas id='canvas' width=10 height=10/>
4 </body>
mlamouri (slow - plz ping) 2016/05/12 13:19:32 I would recommend having this after the scripts. I
mcasas 2016/05/12 16:32:01 Done.
5
6 <script src="../resources/testharness.js"></script>
7 <script src="../resources/testharnessreport.js"></script>
8 <script src="../resources/mojo-helpers.js"></script>
9 <script src="resources/mock-imagecapture.js"></script>
10 <script>
11
12 // This test verifies that ImageCapture can takePhoto()s, with a mock Mojo
13 // interface implementation.
14
15 var test = async_test(function() {
mlamouri (slow - plz ping) 2016/05/12 13:19:32 You don't need |test|, right? You can do: `async_
mcasas 2016/05/12 16:32:00 Done.
16 var canvas = document.getElementById('canvas');
17 var context = canvas.getContext("2d");
18 context.fillStyle = "red";
19 context.fillRect(0, 0, 10, 10);
20 var stream = canvas.captureStream();
21
22 mockImageCaptureReady
23 .then((mock) => {
24 var capturer = new ImageCapture(stream.getVideoTracks()[0]);
25
26 capturer.takePhoto()
27 .then(blob => {
28 assert_true(blob.size > 0);
29 this.done();
mlamouri (slow - plz ping) 2016/05/12 13:19:32 I would recommend using `t`, this is how it is usu
mcasas 2016/05/12 16:32:00 Done.
30 })
31 .catch(error => {
32 assert_unreached("Error during takePhoto(): " + error);
33 });
34 })
35 .catch(error => {
36 assert_unreached("Error creating MockImageCapture: " + error);
37 });
38 }, 'exercises the ImageCapture API takePhoto()');
39
40 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698