waitTask should survive cross-process navigation (#435)

In case of cross-process navigation, we receive a context
which is immediately getting destroyed.

Fixes #396.
This commit is contained in:
Andrey Lushnikov
2017-08-21 13:34:26 -07:00
committed by GitHub
parent c1731dd5d7
commit afd90123be
2 changed files with 9 additions and 3 deletions

View File

@@ -419,6 +419,11 @@ class WaitTask {
if (error && error.message.includes('Execution context was destroyed'))
return;
// We could have tried to evaluate in a context which was already
// destroyed.
if (error && error.message.includes('Cannot find context with specified id'))
return;
if (error)
this._reject(error);
else