1/** 2 * Remove the `reftest-wait` class on the document element. 3 * The reftest runner will wait with taking a screenshot while 4 * this class is present. 5 * 6 * See https://web-platform-tests.org/writing-tests/reftests.html#controlling-when-comparison-occurs 7 */ 8function takeScreenshot() { 9 document.documentElement.classList.remove("reftest-wait"); 10} 11 12/** 13 * Call `takeScreenshot()` after a delay of at least |timeout| milliseconds. 14 * @param {number} timeout - milliseconds 15 */ 16function takeScreenshotDelayed(timeout) { 17 setTimeout(function() { 18 takeScreenshot(); 19 }, timeout); 20} 21