Debian Codegraph @

testing/web-platform/mozilla/tests/webgpu/common/util/wpt_reftest_wait.js

raw
1 /**
2 * AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
3 **/import { timeout } from './timeout.js'; // Copied from https://github.com/web-platform-tests/wpt/blob/master/common/reftest-wait.js
4
5 /**
6 * Remove the `reftest-wait` class on the document element.
7 * The reftest runner will wait with taking a screenshot while
8 * this class is present.
9 *
10 * See https://web-platform-tests.org/writing-tests/reftests.html#controlling-when-comparison-occurs
11 */
12 export function takeScreenshot() {
13 document.documentElement.classList.remove('reftest-wait');
14 }
15
16 /**
17 * Call `takeScreenshot()` after a delay of at least `ms` milliseconds.
18 * @param {number} ms - milliseconds
19 */
20 export function takeScreenshotDelayed(ms) {
21 timeout(() => {
22 takeScreenshot();
23 }, ms);
24 }