From 60567575d27c6fd9294044b397cef59a178fe06a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 15 Mar 2019 21:01:36 -0700 Subject: [PATCH] test: make sure frames are reported from-inside shadow DOM (#4167) References #4163. --- test/frame.spec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/frame.spec.js b/test/frame.spec.js index e17904c4..55d0dd94 100644 --- a/test/frame.spec.js +++ b/test/frame.spec.js @@ -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 => {