| 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 fill_light_mode : imageCapture.FillLightMode.AUTO, |
| 28 red_eye_reduction : true, |
| 28 }}; | 29 }}; |
| 29 this.settings_ = null; | 30 this.settings_ = null; |
| 30 } | 31 } |
| 31 | 32 |
| 32 bindToPipe(pipe) { | 33 bindToPipe(pipe) { |
| 33 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); | 34 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); |
| 34 bindings.StubBindings(this.stub_).delegate = this; | 35 bindings.StubBindings(this.stub_).delegate = this; |
| 35 } | 36 } |
| 36 | 37 |
| 37 getCapabilities(source_id) { | 38 getCapabilities(source_id) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 return this.capabilities_.capabilities; | 53 return this.capabilities_.capabilities; |
| 53 } | 54 } |
| 54 | 55 |
| 55 options() { | 56 options() { |
| 56 return this.settings_; | 57 return this.settings_; |
| 57 } | 58 } |
| 58 | 59 |
| 59 } | 60 } |
| 60 return new MockImageCapture(); | 61 return new MockImageCapture(); |
| 61 }); | 62 }); |
| OLD | NEW |