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

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

Issue 2387303002: Image Capture Linux/CrOs, implement brightness, contrast, saturation and sharpness (Closed)
Patch Set: Explicitly initialize to empty the new fields in the Android implementation and rebase Created 4 years, 2 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/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 red_eye_reduction : true,
29 color_temperature : { min : 2500, max : 6500, current : 6000 }, 29 color_temperature : { min : 2500, max : 6500, current : 6000 },
30 brightness : { min : 1, max : 10, current : 5 },
31 contrast : { min : 2, max : 9, current : 5 },
32 saturation : { min : 3, max : 8, current : 6 },
33 sharpness : { min : 4, max : 7, current : 7 },
30 }}; 34 }};
31 this.settings_ = null; 35 this.settings_ = null;
32 } 36 }
33 37
34 bindToPipe(pipe) { 38 bindToPipe(pipe) {
35 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture); 39 this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture);
36 bindings.StubBindings(this.stub_).delegate = this; 40 bindings.StubBindings(this.stub_).delegate = this;
37 } 41 }
38 42
39 getCapabilities(source_id) { 43 getCapabilities(source_id) {
(...skipping 14 matching lines...) Expand all
54 return this.capabilities_.capabilities; 58 return this.capabilities_.capabilities;
55 } 59 }
56 60
57 options() { 61 options() {
58 return this.settings_; 62 return this.settings_;
59 } 63 }
60 64
61 } 65 }
62 return new MockImageCapture(); 66 return new MockImageCapture();
63 }); 67 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698