Skip to content

Commit

Permalink
feat(firefox): roll ff and ff-beta to 1442 (#29751)
Browse files Browse the repository at this point in the history
This requires changes in `FFPage`.
Also fixing a new ff-specific test that introduced flakiness on the
bots.

Closes #29750
Closes #29724
Closes #29681
Closes #29678
  • Loading branch information
dgozman authored Feb 29, 2024
1 parent 532d8e5 commit 0f30cda
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
},
{
"name": "firefox",
"revision": "1440",
"revision": "1442",
"installByDefault": true,
"browserVersion": "123.0"
},
{
"name": "firefox-asan",
"revision": "1440",
"revision": "1442",
"installByDefault": false,
"browserVersion": "123.0"
},
{
"name": "firefox-beta",
"revision": "1440",
"revision": "1442",
"installByDefault": false,
"browserVersion": "124.0b3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/chromium/crPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ export class CRPage implements PageDelegate {
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();
if (!frame)
throw new Error('Cannot set input files to detached input element');
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
await this._page._frameManager.waitForSignalsCreatedBy(progress, options.noWaitAfter, async () => {
progress.throwIfAborted(); // Avoid action that has side-effects.
if (localPaths)
await this._page._delegate.setInputFilePaths(progress, retargeted, localPaths);
await this._page._delegate.setInputFilePaths(retargeted, localPaths);
else
await this._page._delegate.setInputFiles(retargeted, filePayloads!);
});
Expand Down
4 changes: 1 addition & 3 deletions packages/playwright-core/src/server/firefox/ffPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,12 @@ export class FFPage implements PageDelegate {
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', {
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>> {
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface PageDelegate {
getOwnerFrame(handle: dom.ElementHandle): Promise<string | null>; // Returns frameId.
getContentQuads(handle: dom.ElementHandle): Promise<types.Quad[] | null>;
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>;
getFrameElement(frame: frames.Frame): Promise<dom.ElementHandle>;
scrollRectIntoViewIfNeeded(handle: dom.ElementHandle, rect?: types.Rect): Promise<'error:notvisible' | 'error:notconnected' | 'done'>;
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/src/server/webkit/wkPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ export class WKPage implements PageDelegate {
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 objectId = handle._objectId;
await Promise.all([
Expand Down
3 changes: 3 additions & 0 deletions tests/library/browsercontext-basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(page2)).toBe(CLICK_COUNT);

await page1.close();
await page2.close();
});

it('window.open should use parent tab context', async function({ browser, server }) {
Expand Down

0 comments on commit 0f30cda

Please sign in to comment.