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

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

Issue 2590393002: Revert of Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
diff --git a/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js b/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
index 5d543e6b7ac84f280145893a8fe52ef6544a8510..e712c32ae5436701b1cc1db9538ff9dff7685b52 100644
--- a/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
+++ b/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
@@ -4,14 +4,15 @@
'mockImageCapture',
['media/capture/mojo/image_capture.mojom',
'mojo/public/js/bindings',
+ 'mojo/public/js/connection',
'content/public/renderer/interfaces',
- ], (imageCapture, bindings, interfaces) => {
+ ], (imageCapture, bindings, connection, interfaces) => {
class MockImageCapture {
constructor() {
interfaces.addInterfaceOverrideForTesting(
imageCapture.ImageCapture.name,
- handle => this.bindingSet_.addBinding(this, handle));
+ pipe => this.bindToPipe(pipe));
this.capabilities_ = { capabilities : {
iso : { min : 100.0, max : 12000.0, current : 400.0, step : 1.0 },
@@ -33,7 +34,11 @@
sharpness : { min : 4.0, max : 7.0, current : 7.0, step : 1.0 },
}};
this.settings_ = null;
- this.bindingSet_ = new bindings.BindingSet(imageCapture.ImageCapture);
+ }
+
+ bindToPipe(pipe) {
+ this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture);
+ bindings.StubBindings(this.stub_).delegate = this;
}
getCapabilities(source_id) {

Powered by Google App Engine
This is Rietveld 408576698