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;
|
resolver = resolve;
|
||||||
rejector = reject;
|
rejector = reject;
|
||||||
});
|
});
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId =
|
||||||
isRejected = true;
|
timeout > 0
|
||||||
rejector(new TimeoutError(timeoutMessage));
|
? setTimeout(() => {
|
||||||
}, timeout);
|
isRejected = true;
|
||||||
|
rejector(new TimeoutError(timeoutMessage));
|
||||||
|
}, timeout)
|
||||||
|
: undefined;
|
||||||
return Object.assign(taskPromise, {
|
return Object.assign(taskPromise, {
|
||||||
resolved: () => {
|
resolved: () => {
|
||||||
return isResolved;
|
return isResolved;
|
||||||
|
Loading…
Reference in New Issue
Block a user