| 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 }, | 18 iso : { min : 100, max : 12000, current : 400 }, |
| 19 height : { min : 240, max : 2448, current : 240 }, | 19 height : { min : 240, max : 2448, current : 240 }, |
| 20 width : { min : 320, max : 3264, current : 320 }, | 20 width : { min : 320, max : 3264, current : 320 }, |
| 21 width : { min : 320, max : 3264, current : 320 }, | 21 width : { min : 320, max : 3264, current : 320 }, |
| 22 zoom : { min : 0, max : 10, current : 5 }, | 22 zoom : { min : 0, max : 10, current : 5 }, |
| 23 focus_mode : imageCapture.MeteringMode.MANUAL, | 23 focus_mode : imageCapture.MeteringMode.MANUAL, |
| 24 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, | 24 exposure_mode : imageCapture.MeteringMode.SINGLE_SHOT, |
| 25 exposure_compensation : { min : -200, max : 200, current : 33}, | 25 exposure_compensation : { min : -200, max : 200, current : 33}, |
| 26 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, | 26 white_balance_mode : imageCapture.MeteringMode.CONTINUOUS, |
| 27 fill_light_mode : imageCapture.FillLightMode.AUTO, |
| 27 }}; | 28 }}; |
| 28 this.settings_ = null; | 29 this.settings_ = null; |
| 29 } | 30 } |
| 30 | 31 |
| 31 bindToPipe(pipe) { | 32 bindToPipe(pipe) { |
| 32 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); | 33 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); |
| 33 bindings.StubBindings(this.stub_).delegate = this; | 34 bindings.StubBindings(this.stub_).delegate = this; |
| 34 } | 35 } |
| 35 | 36 |
| 36 getCapabilities(source_id) { | 37 getCapabilities(source_id) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 51 return this.capabilities_.capabilities; | 52 return this.capabilities_.capabilities; |
| 52 } | 53 } |
| 53 | 54 |
| 54 options() { | 55 options() { |
| 55 return this.settings_; | 56 return this.settings_; |
| 56 } | 57 } |
| 57 | 58 |
| 58 } | 59 } |
| 59 return new MockImageCapture(); | 60 return new MockImageCapture(); |
| 60 }); | 61 }); |
| OLD | NEW |