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

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: mlamouri@ comments 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 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/mock-imagecapture.js"></script>
6 <body>
7 <canvas id='canvas' width=10 height=10/>
8 </body>
9 <script>
10
11 // This test verifies that ImageCapture can takePhoto()s, with a mock Mojo
12 // interface implementation.
13
14 async_test(function(t) {
15 var canvas = document.getElementById('canvas');
16 var context = canvas.getContext("2d");
17 context.fillStyle = "red";
18 context.fillRect(0, 0, 10, 10);
19 var stream = canvas.captureStream();
20
21 mockImageCaptureReady
22 .then((mock) => {
23 var capturer = new ImageCapture(stream.getVideoTracks()[0]);
24
25 capturer.takePhoto()
26 .then(blob => {
27 assert_true(blob.size > 0);
28 t.done();
29 })
30 .catch(error => {
31 assert_unreached("Error during takePhoto(): " + error);
32 });
33 })
34 .catch(error => {
35 assert_unreached("Error creating MockImageCapture: " + error);
36 });
37 }, 'exercises the ImageCapture API takePhoto()');
38
39 </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