Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 3 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /shape-detection/detection-VideoFrame.https.window.html - WPT Dashboard Interop Dashboard
'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');