Automatic update from web-platform-tests Migrate remaining WPT to Mojo JS modules All remaining WPT using Mojo bindings are migrated to newer module-based bindings here. Support for loading older bindings variants in WPT is removed. Bug: 1004256 Change-Id: I630a6ddb0e5b89f5b7e6c538a273c3725a485aae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2664907 Commit-Queue: Ken Rockot <rockot@google.com> Reviewed-by: Stephen McGruer <smcgruer@chromium.org> Reviewed-by: Michael Moss <mmoss@chromium.org> Reviewed-by: Alexander Cooper <alcooper@chromium.org> Cr-Commit-Position: refs/heads/master@{#849713} -- wpt-commits: e3b2fa58ec722818ab212125275f89f3c8f40d32 wpt-pr: 27429
The shapedetection-helpers.js tests require implementations of
the FaceDetectionTest, BarcodeDetectionTest and TextDetectionTest
interfaces, which should emulate platform shape detection backends.
The FaceDetectionTest interface is defined as:
class FaceDetectionTest {
async initialize(); // Sets up the testing environment.
async reset(); // Frees the resources.
MockFaceDetectionProvider(); //Returns `MockFaceDetectionProvider` interface.
};
class MockFaceDetectionProvider {
getFrameData(); //Gets frame data of detection result.
getMaxDetectedFaces(); //Gets value of `maxDetectedFaces` in `FaceDetector` constructor
getFastMode(); //Gets value of `fastMode` in `FaceDetector` constructor
};
The Chromium implementation of the FaceDetectionTest interface is located in
mock-facedetection.js.
The BarcodeDetectionTest interface is defined as:
class BarcodeDetectionTest {
async initialize(); // Sets up the testing environment.
async reset(); // Frees the resources.
MockBarcodeDetectionProvider(); //Returns `MockBarcodeDetectionProvider` interface.
};
class MockBarcodeDetectionProvider {
async enumerateSupportedFormats(); //Enumerates supported formats
getFrameData(); //Gets frame data of detection result.
getFormats(); //Gets value of `formats` in `BarcodeDetector` constructor
simulateNoImplementation(); // simulate a 'no implementation available' case
};
The Chromium implementation of the BarcodeDetectionTest interface is located in
mock-barcodedetection.js.
The TextDetectionTest interface is defined as:
class TextDetectionTest {
async initialize(); // Sets up the testing environment.
async reset(); // Frees the resources.
MockTextDetection(); //Returns `MockTextDetection` interface.
};
class MockTextDetection {
getFrameData(); //Gets frame data of detection result.
};
The Chromium implementation of the TextDetectionTest interface is located in
mock-textdetection.js.
Other browser vendors should provide their own implementations of
the FaceDetectionTest, BarcodeDetectionTest and TextDetectionTest
interfaces.