Index: third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
index bcf191dda27c2e2c8915e6d2e32bf941bfe0c346..2c5af9e2665b40cf84fbd3f5e1a351563ebe9b6d 100644 |
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
@@ -4,22 +4,18 @@ let mockBarcodeDetectionReady = define( |
'mockBarcodeDetection', |
['third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.mojom', |
'mojo/public/js/bindings', |
- 'mojo/public/js/connection', |
'mojo/public/js/core', |
'content/public/renderer/frame_interfaces', |
- ], (barcodeDetection, bindings, connection, mojo, interfaces) => { |
+ ], (barcodeDetection, bindings, mojo, interfaces) => { |
class MockBarcodeDetection { |
constructor() { |
+ this.bindingSet_ = new bindings.BindingSet( |
+ barcodeDetection.BarcodeDetection); |
+ |
interfaces.addInterfaceOverrideForTesting( |
barcodeDetection.BarcodeDetection.name, |
- pipe => this.bindToPipe(pipe)); |
- } |
- |
- bindToPipe(pipe) { |
- this.stub_ = connection.bindHandleToStub(pipe, |
- barcodeDetection.BarcodeDetection); |
- bindings.StubBindings(this.stub_).delegate = this; |
+ handle => this.bindingSet_.addBinding(this, handle)); |
} |
detect(frame_data, width, height) { |