Skip to content

Commit

Permalink
test: make sure frames are reported from-inside shadow DOM (#4167)
Browse files Browse the repository at this point in the history
References #4163.
  • Loading branch information
aslushnikov authored Mar 16, 2019
1 parent 854b1c0 commit 6056757
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/frame.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ module.exports.addTests = function({testRunner, expect}) {
expect(detachedFrames.length).toBe(4);
expect(navigatedFrames.length).toBe(1);
});
it('should report frame from-inside shadow DOM', async({page, server}) => {
await page.goto(server.PREFIX + '/shadow.html');
await page.evaluate(async url => {
const frame = document.createElement('iframe');
frame.src = url;
document.body.shadowRoot.appendChild(frame);
await new Promise(x => frame.onload = x);
}, server.EMPTY_PAGE);
expect(page.frames().length).toBe(2);
expect(page.frames()[1].url()).toBe(server.EMPTY_PAGE);
});
it('should report frame.name()', async({page, server}) => {
await utils.attachFrame(page, 'theFrameId', server.EMPTY_PAGE);
await page.evaluate(url => {
Expand Down

0 comments on commit 6056757

Please sign in to comment.