feat(webkit): impment ElementHandle.contentFrame

This commit is contained in:
Yury Semikhatsky 2019-12-17 10:20:52 -08:00
parent 5a60a96410
commit ccc69e2e65
3 changed files with 8 additions and 3 deletions

View file

@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "724623",
"firefox_revision": "1007",
"webkit_revision": "1042"
"webkit_revision": "1043"
},
"scripts": {
"unit": "node test/test.js",

View file

@ -384,7 +384,12 @@ export class FrameManager implements PageDelegate {
}
async getContentFrame(handle: dom.ElementHandle): Promise<frames.Frame | null> {
throw new Error('contentFrame() is not implemented');
const nodeInfo = await this._session.send('DOM.describeNode', {
objectId: toRemoteObject(handle).objectId
});
if (!nodeInfo.contentFrameId)
return null;
return this._page._frameManager.frame(nodeInfo.contentFrameId);
}
isElementHandle(remoteObject: any): boolean {

View file

@ -67,7 +67,7 @@ module.exports.addTests = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
});
});
describe.skip(WEBKIT)('ElementHandle.contentFrame', function() {
fdescribe('ElementHandle.contentFrame', function() {
it('should work', async({page,server}) => {
await page.goto(server.EMPTY_PAGE);
await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);