Source code
Revision control
Copy as Markdown
Other Tools
import { timeout } from './timeout.js';
/**
 * Remove the `reftest-wait` class on the document element.
 * The reftest runner will wait with taking a screenshot while
 * this class is present.
 *
 */
export function takeScreenshot() {
  document.documentElement.classList.remove('reftest-wait');
}
/**
 * Call `takeScreenshot()` after a delay of at least `ms` milliseconds.
 * @param {number} ms - milliseconds
 */
export function takeScreenshotDelayed(ms: number) {
  timeout(() => {
    takeScreenshot();
  }, ms);
}