| <script src="../resources/testharness.js"></script> |
| <script src="../resources/testharnessreport.js"></script> |
| <script src="../resources/mojo-helpers.js"></script> |
| <script src="resources/mock-imagecapture.js"></script> |
| <canvas id='canvas' width=10 height=10/> |
| // This test verifies that ImageCapture can takePhoto()s, with a mock Mojo |
| // interface implementation. |
| var canvas = document.getElementById('canvas'); |
| var context = canvas.getContext("2d"); |
| context.fillStyle = "red"; |
| context.fillRect(0, 0, 10, 10); |
| var stream = canvas.captureStream(); |
| return new ImageCapture(stream.getVideoTracks()[0]); |
| assert_unreached("Error creating MockImageCapture: " + error); |
| return capturer.takePhoto(); |
| assert_true(blob.size > 0); |
| assert_unreached("Error during takePhoto(): " + error); |
| }, 'exercises the ImageCapture API takePhoto()'); |