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 // This test verifies that the |constraints| configured in the mock Mojo | 11 // This test verifies that the |constraints| configured in the mock Mojo |
12 // service implementation, are returned by MediaStreamTrack.getSettings(). | 12 // service implementation, are returned by MediaStreamTrack.getSettings(). |
13 | 13 |
14 async_test(function(t) { | 14 async_test(function(t) { |
15 var canvas = document.getElementById('canvas'); | 15 var canvas = document.getElementById('canvas'); |
16 var context = canvas.getContext("2d"); | 16 var context = canvas.getContext("2d"); |
17 context.fillStyle = "red"; | 17 context.fillStyle = "red"; |
18 context.fillRect(0, 0, 10, 10); | 18 context.fillRect(0, 0, 10, 10); |
19 | 19 |
20 const constraints = { advanced : [{ whiteBalanceMode : "manual", | 20 const constraints = { advanced : [{ whiteBalanceMode : "manual", |
21 exposureMode : "continuous", | 21 exposureMode : "continuous", |
22 focusMode : "single-shot", | 22 focusMode : "single-shot", |
23 | 23 |
| 24 pointsOfInterest : [{x : 0.1, y : 0.2}, |
| 25 {x : 0.3, y : 0.4}], |
| 26 |
24 exposureCompensation : 133.77, | 27 exposureCompensation : 133.77, |
25 colorTemperature : 6000, | 28 colorTemperature : 6000, |
26 iso : 120.0, | 29 iso : 120.0, |
27 | 30 |
28 brightness : 3, | 31 brightness : 3, |
29 contrast : 4, | 32 contrast : 4, |
30 saturation : 5, | 33 saturation : 5, |
31 sharpness : 6, | 34 sharpness : 6, |
32 | 35 |
33 zoom : 3.141592 | 36 zoom : 3.141592 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 87 |
85 t.done(); | 88 t.done(); |
86 }) | 89 }) |
87 .catch(error => { | 90 .catch(error => { |
88 assert_unreached("Error applying constraints: " + error.message); | 91 assert_unreached("Error applying constraints: " + error.message); |
89 }); | 92 }); |
90 | 93 |
91 }, 'exercises an applyConstraints() - getSettings() cycle'); | 94 }, 'exercises an applyConstraints() - getSettings() cycle'); |
92 | 95 |
93 </script> | 96 </script> |
OLD | NEW |