Skip to content

Commit 364c2e2

Browse files
committed
[dotnet] [bidi] Get tree command returns GetTreeResult object
1 parent 707dcb4 commit 364c2e2

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContext.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
// under the License.
1818
// </copyright>
1919

20-
using System.Collections.Generic;
2120
using System.Threading.Tasks;
2221
using System;
2322

@@ -117,7 +116,7 @@ public Task HandleUserPromptAsync(HandleUserPromptOptions? options = null)
117116
return BiDi.BrowsingContext.HandleUserPromptAsync(this, options);
118117
}
119118

120-
public Task<IReadOnlyList<BrowsingContextInfo>> GetTreeAsync(BrowsingContextGetTreeOptions? options = null)
119+
public Task<GetTreeResult> GetTreeAsync(BrowsingContextGetTreeOptions? options = null)
121120
{
122121
GetTreeOptions getTreeOptions = new(options)
123122
{

dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextModule.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// </copyright>
1919

2020
using System;
21-
using System.Collections.Generic;
2221
using System.Threading.Tasks;
2322
using OpenQA.Selenium.BiDi.Communication;
2423

@@ -91,13 +90,11 @@ public async Task SetViewportAsync(BrowsingContext context, SetViewportOptions?
9190
await Broker.ExecuteCommandAsync(new SetViewportCommand(@params), options).ConfigureAwait(false);
9291
}
9392

94-
public async Task<IReadOnlyList<BrowsingContextInfo>> GetTreeAsync(GetTreeOptions? options = null)
93+
public async Task<GetTreeResult> GetTreeAsync(GetTreeOptions? options = null)
9594
{
9695
var @params = new GetTreeCommandParameters(options?.MaxDepth, options?.Root);
9796

98-
var getTreeResult = await Broker.ExecuteCommandAsync<GetTreeCommand, GetTreeResult>(new GetTreeCommand(@params), options).ConfigureAwait(false);
99-
100-
return getTreeResult.Contexts;
97+
return await Broker.ExecuteCommandAsync<GetTreeCommand, GetTreeResult>(new GetTreeCommand(@params), options).ConfigureAwait(false);
10198
}
10299

103100
public async Task<PrintResult> PrintAsync(BrowsingContext context, PrintOptions? options = null)

0 commit comments

Comments
 (0)