Skip to content
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
5 changes: 3 additions & 2 deletions dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// under the License.
// </copyright>

using System.Collections.Generic;
using System.Threading.Tasks;
using OpenQA.Selenium.BiDi.Communication;

Expand All @@ -32,7 +31,9 @@ public async Task CloseAsync(CloseOptions? options = null)

public async Task<UserContextInfo> CreateUserContextAsync(CreateUserContextOptions? options = null)
{
return await Broker.ExecuteCommandAsync<CreateUserContextCommand, UserContextInfo>(new CreateUserContextCommand(), options).ConfigureAwait(false);
var @params = new CreateUserContextCommandParameters(options?.AcceptInsecureCerts, options?.Proxy);

return await Broker.ExecuteCommandAsync<CreateUserContextCommand, UserContextInfo>(new CreateUserContextCommand(@params), options).ConfigureAwait(false);
}

public async Task<GetUserContextsResult> GetUserContextsAsync(GetUserContextsOptions? options = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@

namespace OpenQA.Selenium.BiDi.Modules.Browser;

internal class CreateUserContextCommand()
: Command<CommandParameters, UserContextInfo>(CommandParameters.Empty, "browser.createUserContext");
internal class CreateUserContextCommand(CreateUserContextCommandParameters @params)
: Command<CreateUserContextCommandParameters, UserContextInfo>(@params, "browser.createUserContext");

public record CreateUserContextOptions : CommandOptions;
internal record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;

public record CreateUserContextOptions : CommandOptions
{
public bool? AcceptInsecureCerts { get; set; }

public Session.ProxyConfiguration? Proxy { get; set; }
}
Loading