mirror of
https://github.com/servo/servo.git
synced 2025-07-09 16:33:40 +01:00
.. | ||
resources | ||
detected-boundingBox-read-only.html | ||
detection-getSupportedFormats.html | ||
detection-HTMLCanvasElement.html | ||
detection-HTMLImageElement.html | ||
detection-HTMLVideoElement.html | ||
detection-ImageBitmap.html | ||
detection-ImageData-detached.html | ||
detection-ImageData.html | ||
detection-on-worker.worker.js | ||
detection-options.html | ||
detection-security-test.html | ||
detector-same-object.html | ||
idlharness.any.js | ||
META.yml | ||
README.md | ||
shapedetection-cross-origin.sub.html | ||
shapedetection-empty-input.html |
The shapedetection-helpers.js
tests require implementations of
the FaceDetectionTest
and BarcodeDetectionTest
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
};
The Chromium implementation of the BarcodeDetectionTest
interface is located in
mock-barcodedetection.js.
Other browser vendors should provide their own implementations of
the FaceDetectionTest
and BarcodeDetectionTest
interfaces.