| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 let mockImageCaptureReady = define( | 3 let mockImageCaptureReady = define( |
| 4 'mockImageCapture', | 4 'mockImageCapture', |
| 5 ['media/mojo/interfaces/image_capture.mojom', | 5 ['media/mojo/interfaces/image_capture.mojom', |
| 6 'mojo/public/js/bindings', | 6 'mojo/public/js/bindings', |
| 7 'mojo/public/js/connection', | 7 'mojo/public/js/connection', |
| 8 'content/public/renderer/interfaces', | 8 'content/public/renderer/interfaces', |
| 9 ], (imageCapture, bindings, connection, interfaces) => { | 9 ], (imageCapture, bindings, connection, interfaces) => { |
| 10 | 10 |
| 11 class MockImageCapture { | 11 class MockImageCapture { |
| 12 constructor() { | 12 constructor() { |
| 13 interfaces.addInterfaceOverrideForTesting( | 13 interfaces.addInterfaceOverrideForTesting( |
| 14 imageCapture.ImageCapture.name, | 14 imageCapture.ImageCapture.name, |
| 15 pipe => this.bindToPipe(pipe)); | 15 pipe => this.bindToPipe(pipe)); |
| 16 | 16 |
| 17 this.capabilities_ = { capabilities : { | 17 this.capabilities_ = { capabilities : { |
| 18 iso : { min : 100, max : 12000, current : 400, step : 1 }, | 18 iso : { min : 100.0, max : 12000.0, current : 400.0, step : 1.0 }, |
| 19 height : { min : 240, max : 2448, current : 240, step : 2 }, | 19 height : { min : 240.0, max : 2448.0, current : 240.0, step : 2.0 }, |
| 20 width : { min : 320, max : 3264, current : 320, step : 3 }, | 20 width : { min : 320.0, max : 3264.0, current : 320.0, step : 3.0 }, |
| 21 zoom : { min : 0, max : 10, current : 5, step : 5 }, | 21 zoom : { min : 0.0, max : 10.0, current : 5.0, step : 5.0 }, |
| 22 focus_mode : imageCapture.MeteringMode.MANUAL, | 22 focus_mode : imageCapture.MeteringMode.MANUAL, |
| 23 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, | 23 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, |
| 24 exposure_compensation : | 24 exposure_compensation : |
| 25 { min : -200, max : 200, current : 33, step : 33}, | 25 { min : -200.0, max : 200.0, current : 33.0, step : 33.0}, |
| 26 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, | 26 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, |
| 27 fill_light_mode : imageCapture.FillLightMode.AUTO, | 27 fill_light_mode : imageCapture.FillLightMode.AUTO, |
| 28 red_eye_reduction : true, | 28 red_eye_reduction : true, |
| 29 color_temperature : | 29 color_temperature : |
| 30 { min : 2500, max : 6500, current : 6000, step : 1000 }, | 30 { min : 2500.0, max : 6500.0, current : 6000.0, step : 1000.0 }, |
| 31 brightness : { min : 1, max : 10, current : 5, step : 1 }, | 31 brightness : { min : 1.0, max : 10.0, current : 5.0, step : 1.0 }, |
| 32 contrast : { min : 2, max : 9, current : 5, step : 1 }, | 32 contrast : { min : 2.0, max : 9.0, current : 5.0, step : 1.0 }, |
| 33 saturation : { min : 3, max : 8, current : 6, step : 1 }, | 33 saturation : { min : 3.0, max : 8.0, current : 6.0, step : 1.0 }, |
| 34 sharpness : { min : 4, max : 7, current : 7, step : 1 }, | 34 sharpness : { min : 4.0, max : 7.0, current : 7.0, step : 1.0 }, |
| 35 }}; | 35 }}; |
| 36 this.settings_ = null; | 36 this.settings_ = null; |
| 37 } | 37 } |
| 38 | 38 |
| 39 bindToPipe(pipe) { | 39 bindToPipe(pipe) { |
| 40 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); | 40 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); |
| 41 bindings.StubBindings(this.stub_).delegate = this; | 41 bindings.StubBindings(this.stub_).delegate = this; |
| 42 } | 42 } |
| 43 | 43 |
| 44 getCapabilities(source_id) { | 44 getCapabilities(source_id) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 return this.capabilities_.capabilities; | 59 return this.capabilities_.capabilities; |
| 60 } | 60 } |
| 61 | 61 |
| 62 options() { | 62 options() { |
| 63 return this.settings_; | 63 return this.settings_; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } | 66 } |
| 67 return new MockImageCapture(); | 67 return new MockImageCapture(); |
| 68 }); | 68 }); |
| OLD | NEW |