OLD | NEW |
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 |
11 const meteringModeNames = ["unavailable", "manual", "single-shot", "continuous"]
; | 11 const meteringModeNames = ["none", "manual", "single-shot", "continuous"]; |
| 12 const fillLightModeNames = ["none", "off", "auto", "flash", "torch"]; |
12 | 13 |
13 // This test verifies that ImageCapture can get PhotoCapabilities(), with a mock | 14 // This test verifies that ImageCapture can get PhotoCapabilities(), with a mock |
14 // Mojo interface implementation. | 15 // Mojo interface implementation. |
15 | 16 |
16 async_test(function(t) { | 17 async_test(function(t) { |
17 var canvas = document.getElementById('canvas'); | 18 var canvas = document.getElementById('canvas'); |
18 var context = canvas.getContext("2d"); | 19 var context = canvas.getContext("2d"); |
19 context.fillStyle = "red"; | 20 context.fillStyle = "red"; |
20 context.fillRect(0, 0, 10, 10); | 21 context.fillRect(0, 0, 10, 10); |
21 var stream = canvas.captureStream(); | 22 var stream = canvas.captureStream(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 mock_capabilities.exposure_compensation.max); | 77 mock_capabilities.exposure_compensation.max); |
77 assert_equals(capabilities.exposureCompensation.min, | 78 assert_equals(capabilities.exposureCompensation.min, |
78 mock_capabilities.exposure_compensation.min); | 79 mock_capabilities.exposure_compensation.min); |
79 assert_equals(capabilities.exposureCompensation.current, | 80 assert_equals(capabilities.exposureCompensation.current, |
80 mock_capabilities.exposure_compensation.current); | 81 mock_capabilities.exposure_compensation.current); |
81 | 82 |
82 assert_equals(capabilities.whiteBalanceMode, | 83 assert_equals(capabilities.whiteBalanceMode, |
83 meteringModeNames[mock_capabilities.white_balance_mode], | 84 meteringModeNames[mock_capabilities.white_balance_mode], |
84 'whiteBalanceMode'); | 85 'whiteBalanceMode'); |
85 | 86 |
| 87 assert_equals(capabilities.fillLightMode, |
| 88 fillLightModeNames[mock_capabilities.fill_light_mode], |
| 89 'fillLightMode'); |
| 90 |
86 t.done(); | 91 t.done(); |
87 }) | 92 }) |
88 .catch(error => { | 93 .catch(error => { |
89 assert_unreached("Error during getPhotoCapabilities(): " + error); | 94 assert_unreached("Error during getPhotoCapabilities(): " + error); |
90 }); | 95 }); |
91 | 96 |
92 }, 'exercises the retrieval of Capabilities on ImageCapture API construction'); | 97 }, 'exercises the retrieval of Capabilities on ImageCapture API construction'); |
93 | 98 |
94 </script> | 99 </script> |
OLD | NEW |