(async () => { const browser = await puppeteer.launch({ args: ["--no-sandbox", "--disable-setuid-sandbox"], headless: !DEBUG }); // Stop if the tests didn't complete after one minute. const closeTimeout = setTimeout(async () => { console.log("Puppeteer tests timed out after 60s"); process.exitCode = 2; await closeBrowser(browser); }, 60 * 1000); // Forward all messages from the console to stdout. // The SpecRunner.html contains a reporter which writes the test results // to the console, so we can forward them to stdout. const page = await browser.newPage(); page.on("console", consoleObj => console.log(consoleObj.text())); // The reporter in test/spec/helpers/puppeteer/reporter.js will call the // __jasmineCallback function once all tests have been completed. // The passed argument is a boolean indicating the test result. await page.exposeFunction("__jasmineCallback", async (passed) => { process.exitCode = passed ? 0 : 1; clearTimeout(closeTimeout); await closeBrowser(browser); }); await page.goto(testURL); })();
clearTimeout(this._retryTimeout); this._retryTimeout = null;
componentWillUnmount() { this.mounted = false; clearTimeout(this.createPulseTimer); clearInterval(this.timer); }
handlePanResponderMove(event, gestureState) { if (event.nativeEvent.touches.length > 1) { clearTimeout(this.timeoutId); this.triggerUpdate = false; } }
componentWillReceiveProps (nextProps) { const sizeChanged = (nextProps.width || width) !== this.state.width || (nextProps.height || height) !== this.state.height if (!nextProps.autoplay && this.autoplayTimer) clearTimeout(this.autoplayTimer) this.setState(this.initState(nextProps, sizeChanged)) }
componentWillUnmount() { if (this.timeoutId) { clearTimeout(this.timeoutId); } }
function _timeoutAsync(promise, ms) { return new Promise((resolve, reject) => { let _timer = setTimeout(() => { reject(new Error('API timeout')); }, ms); promise.then((result) => { clearTimeout(_timer); return resolve(result); }, reject); }); }
_cancelGazeToClickTimeout() { // Cancel previous timeout if (this._lastTimeoutId) { clearTimeout(this._lastTimeoutId); this._lastTimeoutId = 0; } // Cancel previous animation this.state.borderWidthAnim.stopAnimation(); this.state.borderWidthAnim.setValue(this._initialBorderWidth); }
handlePanResponderRelease() { clearTimeout(this.timeoutId); this.triggerUpdate = false; this.detach(); }
const setSessionTimeout = (duration) => { clearTimeout(sessionTimeout); sessionTimeout = setTimeout( refreshToken, // eslint-disable-line no-use-before-define (duration - SESSION_TIMEOUT_THRESHOLD) * 1000 ); }
componentWillUnmount() { if (animationTimeout) { clearTimeout(animationTimeout); } }
handlePanResponderMove(event, gestureState) { if (event.nativeEvent.touches.length > 1) { clearTimeout(this.timeoutId); this.triggerUpdate = false; } }
handlePanResponderRelease() { clearTimeout(this.timeoutId); this.triggerUpdate = false; this.detach(); }
/** * Custom wrappers for the various of clear{whatever} functions. We cannot * invoke them directly as this will cause thrown errors in Google Chrome with * an Illegal Invocation Error * * @see #2 * @type {Function} * @api private */ function unsetTimeout(id) { clearTimeout(id); }
componentWillUnmount() { if (animationTimeout) { clearTimeout(animationTimeout); } }