Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js

Issue 2164473002: ImageCapture: wire PhotoCapabilities' ISO, width, height and PhotoSettings' width and height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698