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 = ["none", "manual", "single-shot", "continuous"]; | 11 const meteringModeNames = ["none", "manual", "single-shot", "continuous"]; |
12 | 12 |
13 // This test verifies that we can all MediaStreamTrack.applyConstraints(), with | 13 // This test verifies that we can all MediaStreamTrack.applyConstraints(), with |
14 // a mock Mojo service implementation. | 14 // a mock Mojo service implementation. |
15 | 15 |
16 async_test(function(t) { | 16 async_test(function(t) { |
17 var canvas = document.getElementById('canvas'); | 17 var canvas = document.getElementById('canvas'); |
18 var context = canvas.getContext("2d"); | 18 var context = canvas.getContext("2d"); |
19 context.fillStyle = "red"; | 19 context.fillStyle = "red"; |
20 context.fillRect(0, 0, 10, 10); | 20 context.fillRect(0, 0, 10, 10); |
21 | 21 |
22 const constraints = { advanced : [{ whiteBalanceMode : "manual", | 22 const constraints = { advanced : [{ whiteBalanceMode : "single-shot", |
23 exposureMode : "continuous", | 23 exposureMode : "continuous", |
24 focusMode : "single-shot", | 24 focusMode : "single-shot", |
25 | 25 |
26 pointsOfInterest : [{x : 0.1, y : 0.2}, | 26 pointsOfInterest : [{x : 0.1, y : 0.2}, |
27 {x : 0.3, y : 0.4}], | 27 {x : 0.3, y : 0.4}], |
28 | 28 |
29 exposureCompensation : 133.77, | 29 exposureCompensation : 133.77, |
30 colorTemperature : 6000, | 30 colorTemperature : 6000, |
31 iso : 120.0, | 31 iso : 120.0, |
32 | 32 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 t.done(); | 106 t.done(); |
107 }) | 107 }) |
108 .catch(error => { | 108 .catch(error => { |
109 assert_unreached("applyConstraints(): " + error.message); | 109 assert_unreached("applyConstraints(): " + error.message); |
110 }) | 110 }) |
111 | 111 |
112 }, 'exercises MediaStreamTrack.applyConstraints(constraints)'); | 112 }, 'exercises MediaStreamTrack.applyConstraints(constraints)'); |
113 | 113 |
114 </script> | 114 </script> |
OLD | NEW |