fune/testing/web-platform/tests/shape-detection/detection-VideoFrame.https.window.js
Chris Cunningham cd5763f4b8 Bug 1751150 [wpt PR 32467] - [webcodecs] Deprecate minor spec violations, a=testonly
Automatic update from web-platform-tests
[webcodecs] Deprecate minor spec violations

See bugs, as well as following context
https://chromestatus.com/feature/5667793157488640
https://groups.google.com/a/chromium.org/g/blink-dev/c/dnWY4yKbLX8/

Bug: 1275024, 1281015
Change-Id: I7689dc2c04c096673b7961284fee1d08a00e69e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3390729
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961367}

--

wpt-commits: e4fd9b008a5de96b579c3512b6ffb9dd3cd98b59
wpt-pr: 32467
2022-02-05 11:49:57 +00:00

24 lines
855 B
JavaScript

'use strict';
function createVideoFrame() {
const canvas = document.createElement('canvas');
return new VideoFrame(canvas, {timestamp: 0});
}
promise_test(async (t) => {
const frame = createVideoFrame();
const detector = new FaceDetector();
await promise_rejects_dom(t, 'NotSupportedError', detector.detect(frame));
}, 'FaceDetector.detect() rejects on a VideoFrame');
promise_test(async (t) => {
const frame = createVideoFrame();
const detector = new BarcodeDetector();
await promise_rejects_dom(t, 'NotSupportedError', detector.detect(frame));
}, 'BarcodeDetector.detect() rejects on a VideoFrame');
promise_test(async (t) => {
const frame = createVideoFrame();
const detector = new TextDetector();
await promise_rejects_dom(t, 'NotSupportedError', detector.detect(frame));
}, 'TextDetector.detect() rejects on a VideoFrame');