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 8395550f40c19562c312e7f1b9839afffc3bf72f..ed870babd3f34f07c3743cc48a72a75c2af133d2 100644 |
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js |
@@ -4,18 +4,22 @@ |
'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, mojo, interfaces) => { |
+ ], (barcodeDetection, bindings, connection, mojo, interfaces) => { |
class MockBarcodeDetection { |
constructor() { |
- this.bindingSet_ = new bindings.BindingSet( |
- barcodeDetection.BarcodeDetection); |
- |
interfaces.addInterfaceOverrideForTesting( |
barcodeDetection.BarcodeDetection.name, |
- handle => this.bindingSet_.addBinding(this, handle)); |
+ pipe => this.bindToPipe(pipe)); |
+ } |
+ |
+ bindToPipe(pipe) { |
+ this.stub_ = connection.bindHandleToStub(pipe, |
+ barcodeDetection.BarcodeDetection); |
+ bindings.StubBindings(this.stub_).delegate = this; |
} |
detect(frame_data, width, height) { |