Fix watchdog timer cleanup (#64)

Fix a bug in f7cd004 which prevents the cleanup of the watchdog timer, thus keeping the Node.js process alive for this._maxTime msec no matter what.
This commit is contained in:
Andrea Cardaci 2017-07-08 17:54:28 +02:00 committed by Andrey Lushnikov
parent f7cd0048af
commit ff4a389274

View File

@ -41,7 +41,7 @@ class Navigator {
let certificateError = new Promise(fulfill => this._client.once('Security.certificateError', fulfill)).then(() => false); let certificateError = new Promise(fulfill => this._client.once('Security.certificateError', fulfill)).then(() => false);
let networkIdle = new Promise(fulfill => this._networkIdleCallback = fulfill).then(() => true); let networkIdle = new Promise(fulfill => this._networkIdleCallback = fulfill).then(() => true);
let loadEventFired = new Promise(fulfill => this._client.once('Page.loadEventFired', fulfill)).then(() => true); let loadEventFired = new Promise(fulfill => this._client.once('Page.loadEventFired', fulfill)).then(() => true);
let watchdog = new Promise(fulfill => setTimeout(fulfill, this._maxTime)).then(() => false); let watchdog = new Promise(fulfill => this._maximumTimer = setTimeout(fulfill, this._maxTime)).then(() => false);
// Await for the command to throw exception in case of illegal arguments. // Await for the command to throw exception in case of illegal arguments.
try { try {