Image Capture: add getPhotoSettings() method
This CL adds a method getPhotoSettings() to catch up with
the idl [1], and also adds tests for it.
ToT code calls the two mojo methods (getPhotoState() and SetOptions())
and distinguishes how to Resolve() the Promises via the Blink's
|service_requests_| map. Instead of extending this mechanism, this CL
binds to the OnMojo...() methods one of 4 new callbacks (WTF::Function):
- ResolveWithNothing()
- ResolveWithPhotoSettings()
- ResolveWithPhotoCapabilities()
- ResolveWithMediaTrackConstraints()
So that the different sequences to mojo and back are now:
getPhotoCapabilities --> OnMojoGetPhotoState --> ResolveWithPhotoCapabilities
getPhotoSettings --> OnMojoGetPhotoState --> ResolveWithPhotoSettings
setOptions --> OnMojoSetOptions --> OnMojoGetPhotoState --> ResolveWithNothing
SetMediaTrackConstraints --> OnMojoSetOptions --> OnMojoGetPhotoState --> ResolveWithMediaTrackConstraints
(note that the "set" versions have a cycle of setting and
a cycle of current state readback).
[1] https://github.com/w3c/mediacapture-image/issues/167
Bug: 732521
Change-Id: Id5a3ee3b58cedd289a18fa1c721be390776c6543
Reviewed-on: https://chromium-review.googlesource.com/534754
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480447}
10 files changed