mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
References #8016
This commit is contained in:
parent
768a97cfdc
commit
5901cb321d
@ -1,2 +1,2 @@
|
||||
1284
|
||||
Changed: lushnikov@chromium.org Wed 25 Aug 2021 08:50:22 AM PDT
|
||||
1285
|
||||
Changed: lushnikov@chromium.org Fri 27 Aug 2021 09:23:19 AM PDT
|
||||
|
@ -246,9 +246,9 @@ class PageAgent {
|
||||
}
|
||||
|
||||
_filePickerShown(inputElement) {
|
||||
if (inputElement.ownerGlobal.docShell !== this._docShell)
|
||||
return;
|
||||
const frame = this._findFrameForNode(inputElement);
|
||||
if (!frame)
|
||||
return;
|
||||
this._browserPage.emit('pageFileChooserOpened', {
|
||||
executionContextId: frame.mainExecutionContext().id(),
|
||||
element: frame.mainExecutionContext().rawValueToRemoteObject(inputElement)
|
||||
|
@ -1,2 +1,2 @@
|
||||
1288
|
||||
Changed: joel.einbinder@gmail.com Wed 25 Aug 2021 08:41:36 AM PDT
|
||||
1289
|
||||
Changed: lushnikov@chromium.org Fri 27 Aug 2021 09:23:19 AM PDT
|
||||
|
@ -246,9 +246,9 @@ class PageAgent {
|
||||
}
|
||||
|
||||
_filePickerShown(inputElement) {
|
||||
if (inputElement.ownerGlobal.docShell !== this._docShell)
|
||||
return;
|
||||
const frame = this._findFrameForNode(inputElement);
|
||||
if (!frame)
|
||||
return;
|
||||
this._browserPage.emit('pageFileChooserOpened', {
|
||||
executionContextId: frame.mainExecutionContext().id(),
|
||||
element: frame.mainExecutionContext().rawValueToRemoteObject(inputElement)
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import { test as it, expect } from './pageTest';
|
||||
import { attachFrame } from '../config/utils';
|
||||
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
@ -69,6 +70,17 @@ it('should emit event once', async ({page, server}) => {
|
||||
expect(chooser).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should emit event for iframe', async ({page, server, browserName}) => {
|
||||
it.skip(browserName === 'firefox');
|
||||
const frame = await attachFrame(page, 'frame1', server.EMPTY_PAGE);
|
||||
await frame.setContent(`<input type=file>`);
|
||||
const [chooser] = await Promise.all([
|
||||
new Promise(f => page.once('filechooser', f)),
|
||||
frame.click('input'),
|
||||
]);
|
||||
expect(chooser).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should emit event on/off', async ({page, server}) => {
|
||||
await page.setContent(`<input type=file>`);
|
||||
const [chooser] = await Promise.all([
|
||||
|
Loading…
x
Reference in New Issue
Block a user