From 35dd34afbdd96502066d0f7b6a2460a11e5fb73a Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sun, 15 Sep 2024 11:40:44 +0300 Subject: [PATCH] [dotnet] [bidi] Simplify browsing context type enumeration --- dotnet/src/webdriver/BiDi/BiDi.cs | 2 +- .../BiDi/Modules/BrowsingContext/BrowsingContextModule.cs | 2 +- .../webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dotnet/src/webdriver/BiDi/BiDi.cs b/dotnet/src/webdriver/BiDi/BiDi.cs index 50d0b4e1bf736..db53571e8ad8c 100644 --- a/dotnet/src/webdriver/BiDi/BiDi.cs +++ b/dotnet/src/webdriver/BiDi/BiDi.cs @@ -60,7 +60,7 @@ public static async Task ConnectAsync(string url) return bidi; } - public Task CreateContextAsync(Modules.BrowsingContext.BrowsingContextType type, Modules.BrowsingContext.CreateOptions? options = null) + public Task CreateContextAsync(Modules.BrowsingContext.ContextType type, Modules.BrowsingContext.CreateOptions? options = null) { return BrowsingContextModule.CreateAsync(type, options); } diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs index 7758b57ecccce..fe7a1d3f36343 100644 --- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs +++ b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs @@ -7,7 +7,7 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext; public class BrowsingContextModule(Broker broker) : Module(broker) { - public async Task CreateAsync(BrowsingContextType type, CreateOptions? options = null) + public async Task CreateAsync(ContextType type, CreateOptions? options = null) { var @params = new CreateCommandParameters(type); diff --git a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs index 9f1115c5c632f..86a81bcada46a 100644 --- a/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs +++ b/dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs @@ -4,7 +4,7 @@ namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext; internal class CreateCommand(CreateCommandParameters @params) : Command(@params); -internal record CreateCommandParameters(BrowsingContextType Type) : CommandParameters +internal record CreateCommandParameters(ContextType Type) : CommandParameters { public BrowsingContext? ReferenceContext { get; set; } @@ -22,7 +22,7 @@ public record CreateOptions : CommandOptions public Browser.UserContext? UserContext { get; set; } } -public enum BrowsingContextType +public enum ContextType { Tab, Window