| Index: third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| index c934619418786f85a4096d871e5d6aaa00408647..62220e829325e1faee3485f8f70e0ba81e72dd83 100644
|
| --- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| +++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| @@ -5,30 +5,22 @@ let mockFaceDetectionProviderReady = define(
|
| ['third_party/WebKit/public/platform/modules/shapedetection/facedetection.mojom',
|
| 'third_party/WebKit/public/platform/modules/shapedetection/facedetection_provider.mojom',
|
| 'mojo/public/js/bindings',
|
| - 'mojo/public/js/connection',
|
| 'mojo/public/js/core',
|
| 'content/public/renderer/frame_interfaces',
|
| - ], (faceDetection, faceDetectionProvider, bindings, connection, mojo, interfaces) => {
|
| + ], (faceDetection, faceDetectionProvider, bindings, mojo, interfaces) => {
|
|
|
| class MockFaceDetectionProvider {
|
| constructor() {
|
| + this.bindingSet_ = new bindings.BindingSet(
|
| + faceDetectionProvider.FaceDetectionProvider);
|
| +
|
| interfaces.addInterfaceOverrideForTesting(
|
| faceDetectionProvider.FaceDetectionProvider.name,
|
| - pipe => this.bindToPipe(pipe));
|
| - }
|
| -
|
| - bindToPipe(pipe) {
|
| - this.stub_ = connection.bindHandleToStub(
|
| - pipe, faceDetectionProvider.FaceDetectionProvider);
|
| - bindings.StubBindings(this.stub_).delegate = this;
|
| + handle => this.bindingSet_.addBinding(this, handle));
|
| }
|
|
|
| createFaceDetection(request, options) {
|
| - this.mock_service_ = new MockFaceDetection(options);
|
| - this.mock_service_.stub_ = connection.bindHandleToStub(
|
| - request.handle, faceDetection.FaceDetection);
|
| - bindings.StubBindings(this.mock_service_.stub_).delegate =
|
| - this.mock_service_;
|
| + this.mock_service_ = new MockFaceDetection(request, options);
|
| }
|
|
|
| getFrameData() {
|
| @@ -45,9 +37,11 @@ let mockFaceDetectionProviderReady = define(
|
| }
|
|
|
| class MockFaceDetection {
|
| - constructor(options) {
|
| + constructor(request, options) {
|
| this.maxDetectedFaces_ = options.max_detected_faces;
|
| this.fastMode_ = options.fast_mode;
|
| + this.binding_ = new bindings.Binding(faceDetection.FaceDetection, this,
|
| + request);
|
| }
|
|
|
| detect(frame_data, width, height) {
|
|
|