feat(firefox): roll ff and ff-beta to 1442 (#29751)

This requires changes in `FFPage`.
Also fixing a new ff-specific test that introduced flakiness on the
bots.

Closes https://github.com/microsoft/playwright/pull/29750
Closes https://github.com/microsoft/playwright/pull/29724
Closes https://github.com/microsoft/playwright/pull/29681
Closes https://github.com/microsoft/playwright/pull/29678
This commit is contained in:
Dmitry Gozman 2024-02-29 14:44:45 -08:00 committed by GitHub
parent 532d8e5500
commit 0f30cdab23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 11 additions and 10 deletions

View file

@ -21,19 +21,19 @@
}, },
{ {
"name": "firefox", "name": "firefox",
"revision": "1440", "revision": "1442",
"installByDefault": true, "installByDefault": true,
"browserVersion": "123.0" "browserVersion": "123.0"
}, },
{ {
"name": "firefox-asan", "name": "firefox-asan",
"revision": "1440", "revision": "1442",
"installByDefault": false, "installByDefault": false,
"browserVersion": "123.0" "browserVersion": "123.0"
}, },
{ {
"name": "firefox-beta", "name": "firefox-beta",
"revision": "1440", "revision": "1442",
"installByDefault": false, "installByDefault": false,
"browserVersion": "124.0b3" "browserVersion": "124.0b3"
}, },

View file

@ -345,7 +345,7 @@ export class CRPage implements PageDelegate {
injected.setInputFiles(node, files), files); injected.setInputFiles(node, files), files);
} }
async setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> { async setInputFilePaths(handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> {
const frame = await handle.ownerFrame(); const frame = await handle.ownerFrame();
if (!frame) if (!frame)
throw new Error('Cannot set input files to detached input element'); throw new Error('Cannot set input files to detached input element');

View file

@ -643,7 +643,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => { await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
progress.throwIfAborted(); // Avoid action that has side-effects. progress.throwIfAborted(); // Avoid action that has side-effects.
if (localPaths) if (localPaths)
await this._page._delegate.setInputFilePaths(progress, retargeted, localPaths); await this._page._delegate.setInputFilePaths(retargeted, localPaths);
else else
await this._page._delegate.setInputFiles(retargeted, filePayloads!); await this._page._delegate.setInputFiles(retargeted, filePayloads!);
}); });

View file

@ -543,14 +543,12 @@ export class FFPage implements PageDelegate {
injected.setInputFiles(node, files), files); injected.setInputFiles(node, files), files);
} }
async setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> { async setInputFilePaths(handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void> {
await this._session.send('Page.setFileInputFiles', { await this._session.send('Page.setFileInputFiles', {
frameId: handle._context.frame._id, frameId: handle._context.frame._id,
objectId: handle._objectId, objectId: handle._objectId,
files 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>> { async adoptElementHandle<T extends Node>(handle: dom.ElementHandle<T>, to: dom.FrameExecutionContext): Promise<dom.ElementHandle<T>> {

View file

@ -80,7 +80,7 @@ export interface PageDelegate {
getOwnerFrame(handle: dom.ElementHandle): Promise<string | null>; // Returns frameId. getOwnerFrame(handle: dom.ElementHandle): Promise<string | null>; // Returns frameId.
getContentQuads(handle: dom.ElementHandle): Promise<types.Quad[] | null>; getContentQuads(handle: dom.ElementHandle): Promise<types.Quad[] | null>;
setInputFiles(handle: dom.ElementHandle<HTMLInputElement>, files: types.FilePayload[]): Promise<void>; setInputFiles(handle: dom.ElementHandle<HTMLInputElement>, files: types.FilePayload[]): Promise<void>;
setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void>; setInputFilePaths(handle: dom.ElementHandle<HTMLInputElement>, files: string[]): Promise<void>;
getBoundingBox(handle: dom.ElementHandle): Promise<types.Rect | null>; getBoundingBox(handle: dom.ElementHandle): Promise<types.Rect | null>;
getFrameElement(frame: frames.Frame): Promise<dom.ElementHandle>; getFrameElement(frame: frames.Frame): Promise<dom.ElementHandle>;
scrollRectIntoViewIfNeeded(handle: dom.ElementHandle, rect?: types.Rect): Promise<'error:notvisible' | 'error:notconnected' | 'done'>; scrollRectIntoViewIfNeeded(handle: dom.ElementHandle, rect?: types.Rect): Promise<'error:notvisible' | 'error:notconnected' | 'done'>;

View file

@ -966,7 +966,7 @@ export class WKPage implements PageDelegate {
await this._session.send('DOM.setInputFiles', { objectId, files: protocolFiles }); await this._session.send('DOM.setInputFiles', { objectId, files: protocolFiles });
} }
async setInputFilePaths(progress: Progress, handle: dom.ElementHandle<HTMLInputElement>, paths: string[]): Promise<void> { async setInputFilePaths(handle: dom.ElementHandle<HTMLInputElement>, paths: string[]): Promise<void> {
const pageProxyId = this._pageProxySession.sessionId; const pageProxyId = this._pageProxySession.sessionId;
const objectId = handle._objectId; const objectId = handle._objectId;
await Promise.all([ await Promise.all([

View file

@ -62,6 +62,9 @@ it('should be able to click across browser contexts', async function({ browser }
]); ]);
expect(await getClicks(page1)).toBe(CLICK_COUNT); expect(await getClicks(page1)).toBe(CLICK_COUNT);
expect(await getClicks(page2)).toBe(CLICK_COUNT); expect(await getClicks(page2)).toBe(CLICK_COUNT);
await page1.close();
await page2.close();
}); });
it('window.open should use parent tab context', async function({ browser, server }) { it('window.open should use parent tab context', async function({ browser, server }) {