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

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

Issue 2571903003: Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: remove the changes to web_ui_mojo.js which seemed to cause flakiness. 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 e712c32ae5436701b1cc1db9538ff9dff7685b52..5d543e6b7ac84f280145893a8fe52ef6544a8510 100644
--- a/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
+++ b/third_party/WebKit/LayoutTests/imagecapture/resources/mock-imagecapture.js
@@ -4,15 +4,14 @@ let mockImageCaptureReady = define(
'mockImageCapture',
['media/capture/mojo/image_capture.mojom',
'mojo/public/js/bindings',
- 'mojo/public/js/connection',
'content/public/renderer/interfaces',
- ], (imageCapture, bindings, connection, interfaces) => {
+ ], (imageCapture, bindings, interfaces) => {
class MockImageCapture {
constructor() {
interfaces.addInterfaceOverrideForTesting(
imageCapture.ImageCapture.name,
- pipe => this.bindToPipe(pipe));
+ handle => this.bindingSet_.addBinding(this, handle));
this.capabilities_ = { capabilities : {
iso : { min : 100.0, max : 12000.0, current : 400.0, step : 1.0 },
@@ -34,11 +33,7 @@ let mockImageCaptureReady = define(
sharpness : { min : 4.0, max : 7.0, current : 7.0, step : 1.0 },
}};
this.settings_ = null;
- }
-
- bindToPipe(pipe) {
- this.stub_ = connection.bindHandleToStub(pipe, imageCapture.ImageCapture);
- bindings.StubBindings(this.stub_).delegate = this;
+ this.bindingSet_ = new bindings.BindingSet(imageCapture.ImageCapture);
}
getCapabilities(source_id) {

Powered by Google App Engine
This is Rietveld 408576698