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_ = { | 16 this.state_ = { |
17 capabilities: { | 17 capabilities: { |
18 supported_white_balance_modes: [ | 18 supported_white_balance_modes: [ |
19 imageCapture.MeteringMode.SINGLE_SHOT, | 19 imageCapture.MeteringMode.SINGLE_SHOT, |
20 imageCapture.MeteringMode.CONTINUOUS | 20 imageCapture.MeteringMode.CONTINUOUS |
21 ], | 21 ], |
22 current_white_balance_mode: imageCapture.MeteringMode.CONTINUOUS, | 22 current_white_balance_mode: imageCapture.MeteringMode.CONTINUOUS, |
23 supported_exposure_modes: [ | 23 supported_exposure_modes: [ |
24 imageCapture.MeteringMode.SINGLE_SHOT, | 24 imageCapture.MeteringMode.SINGLE_SHOT, |
25 imageCapture.MeteringMode.CONTINUOUS | 25 imageCapture.MeteringMode.CONTINUOUS |
26 ], | 26 ], |
27 current_exposure_mode: imageCapture.MeteringMode.SINGLE_SHOT, | 27 current_exposure_mode: imageCapture.MeteringMode.SINGLE_SHOT, |
28 supported_focus_modes: [imageCapture.MeteringMode.MANUAL], | 28 supported_focus_modes: [ |
| 29 imageCapture.MeteringMode.MANUAL, |
| 30 imageCapture.MeteringMode.SINGLE_SHOT |
| 31 ], |
29 current_focus_mode: imageCapture.MeteringMode.MANUAL, | 32 current_focus_mode: imageCapture.MeteringMode.MANUAL, |
30 points_of_interest: [{x: 0.4, y: 0.6}], | 33 points_of_interest: [{x: 0.4, y: 0.6}], |
31 | 34 |
32 exposure_compensation: | 35 exposure_compensation: |
33 {min: -200.0, max: 200.0, current: 33.0, step: 33.0}, | 36 {min: -200.0, max: 200.0, current: 33.0, step: 33.0}, |
34 color_temperature: | 37 color_temperature: |
35 {min: 2500.0, max: 6500.0, current: 6000.0, step: 1000.0}, | 38 {min: 2500.0, max: 6500.0, current: 6000.0, step: 1000.0}, |
36 iso: {min: 100.0, max: 12000.0, current: 400.0, step: 1.0}, | 39 iso: {min: 100.0, max: 12000.0, current: 400.0, step: 1.0}, |
37 | 40 |
38 brightness: {min: 1.0, max: 10.0, current: 5.0, step: 1.0}, | 41 brightness: {min: 1.0, max: 10.0, current: 5.0, step: 1.0}, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return this.state_.capabilities; | 125 return this.state_.capabilities; |
123 } | 126 } |
124 | 127 |
125 options() { | 128 options() { |
126 return this.settings_; | 129 return this.settings_; |
127 } | 130 } |
128 | 131 |
129 } | 132 } |
130 return new MockImageCapture(); | 133 return new MockImageCapture(); |
131 }); | 134 }); |
OLD | NEW |