mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: use the timeout setting in waitForFileChooser (#8856)
Co-authored-by: Randolf J <jrandolf@google.com>
This commit is contained in:
parent
8d95a9bc92
commit
f477b46f21
@ -31,10 +31,13 @@ export function createDeferredPromiseWithTimer<T>(
|
||||
resolver = resolve;
|
||||
rejector = reject;
|
||||
});
|
||||
const timeoutId = setTimeout(() => {
|
||||
isRejected = true;
|
||||
rejector(new TimeoutError(timeoutMessage));
|
||||
}, timeout);
|
||||
const timeoutId =
|
||||
timeout > 0
|
||||
? setTimeout(() => {
|
||||
isRejected = true;
|
||||
rejector(new TimeoutError(timeoutMessage));
|
||||
}, timeout)
|
||||
: undefined;
|
||||
return Object.assign(taskPromise, {
|
||||
resolved: () => {
|
||||
return isResolved;
|
||||
|
Loading…
Reference in New Issue
Block a user