chore: bump chromium to e049d599a8332b9b2785b0178be74 (master) (#20314)
This commit is contained in:
parent
0090616f7b
commit
3ac3fbdbfb
94 changed files with 670 additions and 1213 deletions
|
@ -40,3 +40,16 @@ export const emittedNTimes = async (emitter: NodeJS.EventEmitter, eventName: str
|
|||
}
|
||||
return p
|
||||
}
|
||||
|
||||
export const emittedUntil = async (emitter: NodeJS.EventEmitter, eventName: string, untilFn: Function) => {
|
||||
const p = new Promise<any[][]>(resolve => {
|
||||
const handler = (...args: any[]) => {
|
||||
if (untilFn(...args)) {
|
||||
emitter.removeListener(eventName, handler)
|
||||
resolve(args)
|
||||
}
|
||||
}
|
||||
emitter.on(eventName, handler)
|
||||
})
|
||||
return p
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue