Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFrame.ChildFrames change from IEnumerable to IReadOnlyCollection #2188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp.Tests/OOPIFTests/OOPIFTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ await FrameUtils.AttachFrameAsync(
TestConstants.CrossProcessHttpPrefix + "/empty.html"
);
await frameTask.WithTimeout();
Assert.Equal(2, Page.MainFrame.ChildFrames.Count());
Assert.Equal(2, Page.MainFrame.ChildFrames.Count);
}

[PuppeteerTest("oopif.spec.ts", "OOPIF", "should track navigations within OOP iframes")]
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal Frame(FrameManager frameManager, string frameId, string parentFrameId,
}

/// <inheritdoc/>
public IEnumerable<IFrame> ChildFrames => FrameManager.FrameTree.GetChildFrames(Id);
public IReadOnlyCollection<IFrame> ChildFrames => FrameManager.FrameTree.GetChildFrames(Id);

/// <inheritdoc/>
public string Name { get; private set; }
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/FrameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ private async Task OnFrameNavigatedAsync(FramePayload framePayload)
// Detach all child frames first.
if (frame != null)
{
while (frame.ChildFrames.Any())
while (frame.ChildFrames.Count > 0)
{
RemoveFramesRecursively(frame.ChildFrames.First() as Frame);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/IFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface IFrame
/// <summary>
/// Gets the child frames of the this frame.
/// </summary>
IEnumerable<IFrame> ChildFrames { get; }
IReadOnlyCollection<IFrame> ChildFrames { get; }

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