fix(ff): stop gap for setInputFiles race (#29696)

This commit is contained in:
Pavel Feldman 2024-02-27 11:50:24 -08:00 committed by GitHub
parent 321e9d72c3
commit 8264bec01e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -544,15 +544,13 @@ export class FFPage implements PageDelegate {
}
async setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> {
await Promise.all([
this._session.send('Page.setFileInputFiles', {
frameId: handle._context.frame._id,
objectId: handle._objectId,
files
}),
handle.dispatchEvent(progress.metadata, 'input'),
handle.dispatchEvent(progress.metadata, 'change')
]);
await this._session.send('Page.setFileInputFiles', {
frameId: handle._context.frame._id,
objectId: handle._objectId,
files
});
await handle.dispatchEvent(progress.metadata, 'input');
await handle.dispatchEvent(progress.metadata, 'change');
}
async adoptElementHandle<T extends Node>(handle: dom.ElementHandle<T>, to: dom.FrameExecutionContext): Promise<dom.ElementHandle<T>> {