| 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/service_registry', | 8 'content/public/renderer/service_registry', |
| 9 ], (imageCapture, bindings, connection, serviceRegistry) => { | 9 ], (imageCapture, bindings, connection, serviceRegistry) => { |
| 10 | 10 |
| 11 class MockImageCapture { | 11 class MockImageCapture { |
| 12 constructor() { | 12 constructor() { |
| 13 serviceRegistry.addServiceOverrideForTesting( | 13 serviceRegistry.addServiceOverrideForTesting( |
| 14 imageCapture.ImageCapture.name, | 14 imageCapture.ImageCapture.name, |
| 15 pipe => this.bindToPipe(pipe)); | 15 pipe => this.bindToPipe(pipe)); |
| 16 | 16 |
| 17 this.capabilities_ = { capabilities: { zoom : { min : 0, max : 10, current
: 5 } } }; | 17 this.capabilities_ = { capabilities : { |
| 18 iso : { min : 100, max : 12000, current : 400 }, |
| 19 height : { min : 240, max : 2448, current : 240 }, |
| 20 width : { min : 320, max : 3264, current : 320 }, |
| 21 width : { min : 320, max : 3264, current : 320 }, |
| 22 zoom : { min : 0, max : 10, current : 5 }, |
| 23 focusMode : "unavailable", |
| 24 }}; |
| 18 this.settings_ = null; | 25 this.settings_ = null; |
| 19 } | 26 } |
| 20 | 27 |
| 21 bindToPipe(pipe) { | 28 bindToPipe(pipe) { |
| 22 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); | 29 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); |
| 23 bindings.StubBindings(this.stub_).delegate = this; | 30 bindings.StubBindings(this.stub_).delegate = this; |
| 24 } | 31 } |
| 25 | 32 |
| 26 getCapabilities(source_id) { | 33 getCapabilities(source_id) { |
| 27 return Promise.resolve(this.capabilities_); | 34 return Promise.resolve(this.capabilities_); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 return this.capabilities_.capabilities; | 48 return this.capabilities_.capabilities; |
| 42 } | 49 } |
| 43 | 50 |
| 44 options() { | 51 options() { |
| 45 return this.settings_; | 52 return this.settings_; |
| 46 } | 53 } |
| 47 | 54 |
| 48 } | 55 } |
| 49 return new MockImageCapture(); | 56 return new MockImageCapture(); |
| 50 }); | 57 }); |
| OLD | NEW |