fune/testing/web-platform/tests/mediacapture-image/takePhoto-without-PhotoCapabilities.https.window.js
Philip Jägenstedt 93eb4fde79 Bug 1792996 [wpt PR 36069] - Fix use of testharness.js/testharnessreport.js in *.window.js tests, a=testonly
Automatic update from web-platform-tests
Fix use of testharness.js/testharnessreport.js in *.window.js tests (#36069)

These scripts are already included in the template that turns
*.window.js into *.window.html. Including the twice leads to the error
"Identifier 'MessageQueue' has already been declared" in these tests
when run using wptrunner. MessageQueue is a class declared here:
https://github.com/web-platform-tests/wpt/blob/master/tools/wptrunner/wptrunner/testharnessreport.js

There's also one case of testharness-helpers.js being removed. That file
doesn't exist, and the assert_promise_rejects_with_message helper is
defined by /bluetooth/resources/bluetooth-test.js.

Add timeout=long for tests that took close to 10 seconds run and then
passed. These were flagged as slow tests by the Taskcluster stability
checks.
--

wpt-commits: 5bcea268ec86f38921015e315c4e297228a443f4
wpt-pr: 36069
2022-10-12 11:08:17 +00:00

6 lines
323 B
JavaScript

promise_test(async t => {
const track = new MediaStreamTrackGenerator('video');
const capturer = new ImageCapture(track);
const settings = await capturer.getPhotoSettings();
await promise_rejects_dom(t, 'UnknownError', capturer.takePhoto(settings));
}, 'exercise takePhoto() on a track without PhotoCapabilities');