| 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 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 imageHeight : 100, | 26 imageHeight : 100, |
| 27 focusMode : "single-shot", | 27 focusMode : "single-shot", |
| 28 pointsOfInterest : [{x : 0.1, y : 0.2}, | 28 pointsOfInterest : [{x : 0.1, y : 0.2}, |
| 29 {x : 0.3, y : 0.4}], | 29 {x : 0.3, y : 0.4}], |
| 30 exposureMode : "continuous", | 30 exposureMode : "continuous", |
| 31 exposureCompensation : 133, | 31 exposureCompensation : 133, |
| 32 whiteBalanceMode : "manual", | 32 whiteBalanceMode : "manual", |
| 33 iso : 120, | 33 iso : 120, |
| 34 redEyeReduction : true, | 34 redEyeReduction : true, |
| 35 fillLightMode : "flash", | 35 fillLightMode : "flash", |
| 36 colorTemperature : 6000, |
| 36 }; | 37 }; |
| 37 mockImageCaptureReady | 38 mockImageCaptureReady |
| 38 .then(mock => { | 39 .then(mock => { |
| 39 theMock = mock; | 40 theMock = mock; |
| 40 return new ImageCapture(stream.getVideoTracks()[0]); | 41 return new ImageCapture(stream.getVideoTracks()[0]); |
| 41 }) | 42 }) |
| 42 .catch(error => { | 43 .catch(error => { |
| 43 assert_unreached("Error creating MockImageCapture: " + error); | 44 assert_unreached("Error creating MockImageCapture: " + error); |
| 44 }) | 45 }) |
| 45 .then(capturer => { | 46 .then(capturer => { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 'has_red_eye_reduction must be true'); | 89 'has_red_eye_reduction must be true'); |
| 89 // Depending on how mojo boolean packing in integers is arranged, this can | 90 // Depending on how mojo boolean packing in integers is arranged, this can |
| 90 // be a number instead of a boolean, compare directly. | 91 // be a number instead of a boolean, compare directly. |
| 91 // TODO(mcasas): Revert to assert_equals() when yzshen@ has sorted it out. | 92 // TODO(mcasas): Revert to assert_equals() when yzshen@ has sorted it out. |
| 92 assert_true(optionsDict.redEyeReduction == theMock.options().red_eye_reduc
tion, | 93 assert_true(optionsDict.redEyeReduction == theMock.options().red_eye_reduc
tion, |
| 93 'red_eye_reduction value'); | 94 'red_eye_reduction value'); |
| 94 assert_equals(true, theMock.options().has_fill_light_mode, 'has_fill_light
_mode must be true'); | 95 assert_equals(true, theMock.options().has_fill_light_mode, 'has_fill_light
_mode must be true'); |
| 95 assert_equals(optionsDict.fillLightMode, | 96 assert_equals(optionsDict.fillLightMode, |
| 96 fillLightModeNames[theMock.options().fill_light_mode], | 97 fillLightModeNames[theMock.options().fill_light_mode], |
| 97 'fillLightMode value'); | 98 'fillLightMode value'); |
| 99 assert_true(theMock.options().has_color_temperature, |
| 100 'has_color_temperature must be true'); |
| 101 assert_equals(optionsDict.colorTemperature, |
| 102 theMock.options().color_temperature, |
| 103 'colorTemperature value'); |
| 98 | 104 |
| 99 t.done(); | 105 t.done(); |
| 100 }) | 106 }) |
| 101 .catch(error => { | 107 .catch(error => { |
| 102 assert_unreached("Error during setOptions(): " + error); | 108 assert_unreached("Error during setOptions(): " + error); |
| 103 }); | 109 }); |
| 104 }, 'exercises the ImageCapture API setOptions()'); | 110 }, 'exercises the ImageCapture API setOptions()'); |
| 105 | 111 |
| 106 </script> | 112 </script> |
| OLD | NEW |