Skip to content

Commit 4e03bfc

Browse files
authored
IFrame.ChildFrames change from IEnumerable to IReadOnlyCollection (#2188)
1 parent 8078848 commit 4e03bfc

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/PuppeteerSharp.Tests/OOPIFTests/OOPIFTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ await FrameUtils.AttachFrameAsync(
3838
TestConstants.CrossProcessHttpPrefix + "/empty.html"
3939
);
4040
await frameTask.WithTimeout();
41-
Assert.Equal(2, Page.MainFrame.ChildFrames.Count());
41+
Assert.Equal(2, Page.MainFrame.ChildFrames.Count);
4242
}
4343

4444
[PuppeteerTest("oopif.spec.ts", "OOPIF", "should track navigations within OOP iframes")]

lib/PuppeteerSharp/Frame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal Frame(FrameManager frameManager, string frameId, string parentFrameId,
2323
}
2424

2525
/// <inheritdoc/>
26-
public IEnumerable<IFrame> ChildFrames => FrameManager.FrameTree.GetChildFrames(Id);
26+
public IReadOnlyCollection<IFrame> ChildFrames => FrameManager.FrameTree.GetChildFrames(Id);
2727

2828
/// <inheritdoc/>
2929
public string Name { get; private set; }

lib/PuppeteerSharp/FrameManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private async Task OnFrameNavigatedAsync(FramePayload framePayload)
372372
// Detach all child frames first.
373373
if (frame != null)
374374
{
375-
while (frame.ChildFrames.Any())
375+
while (frame.ChildFrames.Count > 0)
376376
{
377377
RemoveFramesRecursively(frame.ChildFrames.First() as Frame);
378378
}

lib/PuppeteerSharp/IFrame.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public interface IFrame
4141
/// <summary>
4242
/// Gets the child frames of the this frame.
4343
/// </summary>
44-
IEnumerable<IFrame> ChildFrames { get; }
44+
IReadOnlyCollection<IFrame> ChildFrames { get; }
4545

4646
/// <summary>
4747
/// Gets a value indicating if the frame is detached or not.

0 commit comments

Comments
 (0)