Skip to content

Commit 4686eb9

Browse files
authored
Make sure frames are reported from-inside shadow DOM (#1053)
1 parent 9c3cf6a commit 4686eb9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/PuppeteerSharp.Tests/FrameTests/FrameManagementTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@ public async Task ShouldDetachChildFramesOnNavigation()
112112
Assert.Single(navigatedFrames);
113113
}
114114

115+
[Fact]
116+
public async Task ShouldReportFrameFromInsideShadowDOM()
117+
{
118+
await Page.GoToAsync(TestConstants.ServerUrl + "/shadow.html");
119+
await Page.EvaluateFunctionAsync(@"async url =>
120+
{
121+
const frame = document.createElement('iframe');
122+
frame.src = url;
123+
document.body.shadowRoot.appendChild(frame);
124+
await new Promise(x => frame.onload = x);
125+
}", TestConstants.EmptyPage);
126+
Assert.Equal(2, Page.Frames.Length);
127+
Assert.Single(Page.Frames, frame => frame.Url == TestConstants.EmptyPage);
128+
}
129+
115130
[Fact]
116131
public async Task ShouldReportFrameName()
117132
{

0 commit comments

Comments
 (0)