From ff4a3892741b0a2929a030370bda633051304960 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sat, 8 Jul 2017 17:54:28 +0200 Subject: [PATCH] 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. --- lib/Navigator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Navigator.js b/lib/Navigator.js index 2ce869fcc1c..8d2ff4a4822 100644 --- a/lib/Navigator.js +++ b/lib/Navigator.js @@ -41,7 +41,7 @@ class Navigator { let certificateError = new Promise(fulfill => this._client.once('Security.certificateError', fulfill)).then(() => false); let networkIdle = new Promise(fulfill => this._networkIdleCallback = 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. try {