summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shape-detection/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/shape-detection/README.md
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/shape-detection/README.md')
-rw-r--r--testing/web-platform/tests/shape-detection/README.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shape-detection/README.md b/testing/web-platform/tests/shape-detection/README.md
new file mode 100644
index 0000000000..624b021336
--- /dev/null
+++ b/testing/web-platform/tests/shape-detection/README.md
@@ -0,0 +1,63 @@
+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](../resources/chromium/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](../resources/chromium/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](../resources/chromium/mock-textdetection.js).
+
+Other browser vendors should provide their own implementations of
+the `FaceDetectionTest`, `BarcodeDetectionTest` and `TextDetectionTest`
+interfaces.