| Index: third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| similarity index 53%
|
| rename from third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
|
| rename to third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| index 7c0049d57af514fcf63d4ae2693dfdf85c075833..3efddb27edb3f87ab2ff16846f275a91d7684a61 100644
|
| --- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-shapedetection.js
|
| +++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-facedetection.js
|
| @@ -1,28 +1,28 @@
|
| "use strict";
|
|
|
| -let mockShapeDetectionReady = define(
|
| - 'mockShapeDetection',
|
| - ['third_party/WebKit/public/platform/modules/shapedetection/shapedetection.mojom',
|
| +let mockFaceDetectionReady = define(
|
| + 'mockFaceDetection',
|
| + ['third_party/WebKit/public/platform/modules/shapedetection/facedetection.mojom',
|
| 'mojo/public/js/bindings',
|
| 'mojo/public/js/connection',
|
| 'mojo/public/js/core',
|
| 'content/public/renderer/frame_interfaces',
|
| - ], (shapeDetection, bindings, connection, mojo, interfaces) => {
|
| + ], (faceDetection, bindings, connection, mojo, interfaces) => {
|
|
|
| - class MockShapeDetection {
|
| + class MockFaceDetection {
|
| constructor() {
|
| interfaces.addInterfaceOverrideForTesting(
|
| - shapeDetection.ShapeDetection.name,
|
| + faceDetection.FaceDetection.name,
|
| pipe => this.bindToPipe(pipe));
|
| }
|
|
|
| bindToPipe(pipe) {
|
| this.stub_ = connection.bindHandleToStub(pipe,
|
| - shapeDetection.ShapeDetection);
|
| + faceDetection.FaceDetection);
|
| bindings.StubBindings(this.stub_).delegate = this;
|
| }
|
|
|
| - detectFaces(frame_data, width, height, options) {
|
| + detect(frame_data, width, height, options) {
|
| let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
|
| this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
|
| this.maxDetectedFaces_ = options.max_detected_faces;
|
| @@ -39,24 +39,6 @@ let mockShapeDetectionReady = define(
|
| mojo.unmapBuffer(receivedStruct.buffer);
|
| }
|
|
|
| - detectBarcodes(frame_data, width, height) {
|
| - let receivedStruct = mojo.mapBuffer(frame_data, 0, width*height*4, 0);
|
| - this.buffer_data_ = new Uint32Array(receivedStruct.buffer);
|
| - return Promise.resolve({
|
| - results: [
|
| - {
|
| - raw_value : "cats",
|
| - bounding_box: { x : 1.0, y: 1.0, width: 100.0, height: 100.0 },
|
| - },
|
| - {
|
| - raw_value : "dogs",
|
| - bounding_box: { x : 2.0, y: 2.0, width: 50.0, height: 50.0 },
|
| - },
|
| - ],
|
| - });
|
| - mojo.unmapBuffer(receivedStruct.buffer);
|
| - }
|
| -
|
| getFrameData() {
|
| return this.buffer_data_;
|
| }
|
| @@ -69,5 +51,5 @@ let mockShapeDetectionReady = define(
|
| return this.fastMode_;
|
| }
|
| }
|
| - return new MockShapeDetection();
|
| + return new MockFaceDetection();
|
| });
|
|
|