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

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

Issue 2167313002: ImageCapture: introduce image_capture Blob to allow move-only semantics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: foolip comments and rebase Created 4 years, 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/mock-imagecapture.js"></script> 5 <script src="resources/mock-imagecapture.js"></script>
6 <body> 6 <body>
7 <canvas id='canvas' width=10 height=10/> 7 <canvas id='canvas' width=10 height=10/>
8 </body> 8 </body>
9 <script> 9 <script>
10 10
(...skipping 11 matching lines...) Expand all
22 .then(mock => { 22 .then(mock => {
23 return new ImageCapture(stream.getVideoTracks()[0]); 23 return new ImageCapture(stream.getVideoTracks()[0]);
24 }) 24 })
25 .catch(error => { 25 .catch(error => {
26 assert_unreached("Error creating MockImageCapture: " + error); 26 assert_unreached("Error creating MockImageCapture: " + error);
27 }) 27 })
28 .then(capturer => { 28 .then(capturer => {
29 return capturer.takePhoto(); 29 return capturer.takePhoto();
30 }) 30 })
31 .then(blob => { 31 .then(blob => {
32 assert_true(blob.size > 0); 32 // JS Blob is almost-opaque, can only check |type| and |size|.
33 assert_equals(blob.type, 'image/cat');
34 assert_equals(blob.size, 2);
33 t.done(); 35 t.done();
34 }) 36 })
35 .catch(error => { 37 .catch(error => {
36 assert_unreached("Error during takePhoto(): " + error); 38 assert_unreached("Error during takePhoto(): " + error);
37 }); 39 });
38 }, 'exercises the ImageCapture API takePhoto()'); 40 }, 'exercises the ImageCapture API takePhoto()');
39 41
40 </script> 42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698