fune/testing/web-platform/tests/shape-detection/detection-ImageDataUint16StorageFormat.https.window.js
Blink WPT Bot 74a654cd40 Bug 1874526 [wpt PR 43984] - [wptrunner] Do not include testharness{,report}.js twice, a=testonly
Automatic update from web-platform-tests
[wptrunner] Do not include `testharness{,report}.js` twice (#43984)

Injecting `<script src="/resources/testharness{,report}.js">` is an
implicit behavior of `wptserve` for `.js` files [0].

Including `testharnessreport.js` twice for `content_shell` appears
benign, but causes issues for the default WebDriver testharness
implementation. Exporting this change will enable useful coverage for
such browsers.

A follow-up PR upstream will have `wpt lint` ban such duplicate scripts.

[0]: https://github.com/web-platform-tests/wpt/blob/9e0d5be/tools/serve/serve.py#L273-L451

Bug: 1518022
Change-Id: I7a6e344c82bbaa33adfa578feeb966fa92f08040
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5195267
Commit-Queue: Jonathan Lee <jonathanjlee@google.com>
Reviewed-by: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#1247652}

Co-authored-by: Jonathan Lee <jonathanjlee@google.com>
--

wpt-commits: f66439a5ca42e416c30740cb25a7a72f3dda6d54
wpt-pr: 43984
2024-01-20 10:35:41 +00:00

39 lines
1.1 KiB
JavaScript

// META: script=/shape-detection/resources/shapedetection-helpers.js
const imgUint16 = new ImageData(1024, 1024, {storageFormat: 'uint16'});
// These tests verify that a Detector's detect() can process ImageData with
// uint16 storage format.
const imageDataTests = [
{
createDetector: () => {
return new FaceDetector();
},
mockTestName: 'FaceDetectionTest',
name:
'FaceDetector.detect() can process uint16 storage format ImageData'
},
{
createDetector: () => {
return new BarcodeDetector();
},
mockTestName: 'BarcodeDetectionTest',
name:
'BarcodeDetector.detect() can process uint16 storage format ImageData'
},
{
createDetector: () => {
return new TextDetector();
},
mockTestName: 'TextDetectionTest',
name:
'TextDetector.detect() can process uint16 storage format ImageData'
}
];
for (let imageDataTest of imageDataTests) {
detection_test(imageDataTest.mockTestName, async () => {
let detector = imageDataTest.createDetector();
await detector.detect(imgUint16);
}, imageDataTest.name);
}