OLD | NEW |
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 let mockImageCaptureReady = define( | 3 let mockImageCaptureReady = define( |
4 'mockImageCapture', | 4 'mockImageCapture', |
5 ['media/capture/mojo/image_capture.mojom', | 5 ['media/capture/mojo/image_capture.mojom', |
6 'mojo/public/js/bindings', | 6 'mojo/public/js/bindings', |
7 'content/public/renderer/interfaces', | 7 'content/public/renderer/interfaces', |
8 ], (imageCapture, bindings, interfaces) => { | 8 ], (imageCapture, bindings, interfaces) => { |
9 | 9 |
10 class MockImageCapture { | 10 class MockImageCapture { |
11 constructor() { | 11 constructor() { |
12 interfaces.addInterfaceOverrideForTesting( | 12 interfaces.addInterfaceOverrideForTesting( |
13 imageCapture.ImageCapture.name, | 13 imageCapture.ImageCapture.name, |
14 handle => this.bindingSet_.addBinding(this, handle)); | 14 handle => this.bindingSet_.addBinding(this, handle)); |
15 | 15 |
16 this.state_ = { capabilities : { | 16 this.state_ = { capabilities : { |
17 iso : { min : 100.0, max : 12000.0, current : 400.0, step : 1.0 }, | 17 iso : { min : 100.0, max : 12000.0, current : 400.0, step : 1.0 }, |
18 height : { min : 240.0, max : 2448.0, current : 240.0, step : 2.0 }, | 18 height : { min : 240.0, max : 2448.0, current : 240.0, step : 2.0 }, |
19 width : { min : 320.0, max : 3264.0, current : 320.0, step : 3.0 }, | 19 width : { min : 320.0, max : 3264.0, current : 320.0, step : 3.0 }, |
20 zoom : { min : 0.0, max : 10.0, current : 5.0, step : 5.0 }, | 20 zoom : { min : 0.0, max : 10.0, current : 5.0, step : 5.0 }, |
21 focus_mode : imageCapture.MeteringMode.MANUAL, | 21 focus_mode : imageCapture.MeteringMode.MANUAL, |
22 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, | 22 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, |
23 exposure_compensation : | 23 exposure_compensation : |
24 { min : -200.0, max : 200.0, current : 33.0, step : 33.0}, | 24 { min : -200.0, max : 200.0, current : 33.0, step : 33.0}, |
25 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, | 25 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, |
26 fill_light_mode : [ imageCapture.FillLightMode.AUTO, | 26 fill_light_mode : [ imageCapture.FillLightMode.AUTO, |
27 imageCapture.FillLightMode.FLASH], | 27 imageCapture.FillLightMode.FLASH], |
28 red_eye_reduction : imageCapture.RedEyeReduction.CONTROLLABLE, | 28 red_eye_reduction : imageCapture.RedEyeReduction.CONTROLLABLE, |
| 29 supports_torch : true, |
29 torch : false, | 30 torch : false, |
30 color_temperature : | 31 color_temperature : |
31 { min : 2500.0, max : 6500.0, current : 6000.0, step : 1000.0 }, | 32 { min : 2500.0, max : 6500.0, current : 6000.0, step : 1000.0 }, |
32 brightness : { min : 1.0, max : 10.0, current : 5.0, step : 1.0 }, | 33 brightness : { min : 1.0, max : 10.0, current : 5.0, step : 1.0 }, |
33 contrast : { min : 2.0, max : 9.0, current : 5.0, step : 1.0 }, | 34 contrast : { min : 2.0, max : 9.0, current : 5.0, step : 1.0 }, |
34 saturation : { min : 3.0, max : 8.0, current : 6.0, step : 1.0 }, | 35 saturation : { min : 3.0, max : 8.0, current : 6.0, step : 1.0 }, |
35 sharpness : { min : 4.0, max : 7.0, current : 7.0, step : 1.0 }, | 36 sharpness : { min : 4.0, max : 7.0, current : 7.0, step : 1.0 }, |
36 points_of_interest : [{x : 0.4, y : 0.6}], | 37 points_of_interest : [{x : 0.4, y : 0.6}], |
37 }}; | 38 }}; |
38 this.settings_ = null; | 39 this.settings_ = null; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return this.state_.capabilities; | 105 return this.state_.capabilities; |
105 } | 106 } |
106 | 107 |
107 options() { | 108 options() { |
108 return this.settings_; | 109 return this.settings_; |
109 } | 110 } |
110 | 111 |
111 } | 112 } |
112 return new MockImageCapture(); | 113 return new MockImageCapture(); |
113 }); | 114 }); |
OLD | NEW |