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
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/ClientWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record ClientWindow
public sealed record ClientWindow
{
internal ClientWindow(string id)
{
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/ClientWindowInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);
public sealed record ClientWindowInfo(bool Active, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);

public enum ClientWindowState
{
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/BiDi/Browser/CloseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class CloseCommand()
internal sealed class CloseCommand()
: Command<CommandParameters, EmptyResult>(CommandParameters.Empty, "browser.close");

public record CloseOptions : CommandOptions;
public sealed class CloseOptions : CommandOptions;
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/CreateUserContextCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

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

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

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

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/GetClientWindowsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class GetClientWindowsCommand()
internal sealed class GetClientWindowsCommand()
: Command<CommandParameters, GetClientWindowsResult>(CommandParameters.Empty, "browser.getClientWindows");

public record GetClientWindowsOptions : CommandOptions;
public sealed class GetClientWindowsOptions : CommandOptions;

public record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
public sealed record GetClientWindowsResult : EmptyResult, IReadOnlyList<ClientWindowInfo>
{
private readonly IReadOnlyList<ClientWindowInfo> _clientWindows;

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/GetUserContextsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class GetUserContextsCommand()
internal sealed class GetUserContextsCommand()
: Command<CommandParameters, GetUserContextsResult>(CommandParameters.Empty, "browser.getUserContexts");

public record GetUserContextsOptions : CommandOptions;
public class GetUserContextsOptions : CommandOptions;

public record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
public sealed record GetUserContextsResult : EmptyResult, IReadOnlyList<UserContextInfo>
{
private readonly IReadOnlyList<UserContextInfo> _userContexts;

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Browser/RemoveUserContextCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace OpenQA.Selenium.BiDi.Browser;

internal class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
internal sealed class RemoveUserContextCommand(RemoveUserContextCommandParameters @params)
: Command<RemoveUserContextCommandParameters, EmptyResult>(@params, "browser.removeUserContext");

internal record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;
internal sealed record RemoveUserContextCommandParameters(UserContext UserContext) : CommandParameters;

public record RemoveUserContextOptions : CommandOptions;
public sealed class RemoveUserContextOptions : CommandOptions;
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/UserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.Browser;

public class UserContext : IAsyncDisposable
public sealed class UserContext : IAsyncDisposable
{
private readonly BiDi _bidi;

Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/BiDi/Browser/UserContextInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

namespace OpenQA.Selenium.BiDi.Browser;

public record UserContextInfo(UserContext UserContext) : EmptyResult;
public sealed record UserContextInfo(UserContext UserContext) : EmptyResult;
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/BrowsingContext/ActivateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class ActivateCommand(ActivateCommandParameters @params)
internal sealed class ActivateCommand(ActivateCommandParameters @params)
: Command<ActivateCommandParameters, EmptyResult>(@params, "browsingContext.activate");

internal record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;
internal sealed record ActivateCommandParameters(BrowsingContext Context) : CommandParameters;

public record ActivateOptions : CommandOptions;
public sealed class ActivateOptions : CommandOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContext
public sealed class BrowsingContext
{
internal BrowsingContext(BiDi bidi, string id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public record BrowsingContextInfo(BiDi BiDi, IReadOnlyList<BrowsingContextInfo>? Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext? OriginalOpener, string Url, Browser.UserContext UserContext)
public sealed record BrowsingContextInfo(BiDi BiDi, IReadOnlyList<BrowsingContextInfo>? Children, Browser.ClientWindow ClientWindow, BrowsingContext Context, BrowsingContext? OriginalOpener, string Url, Browser.UserContext UserContext)
: BrowsingContextEventArgs(BiDi, Context)
{
[JsonInclude]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
public sealed class BrowsingContextInputModule(BrowsingContext context, InputModule inputModule)
{
public Task PerformActionsAsync(IEnumerable<SourceActions> actions, PerformActionsOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
public sealed class BrowsingContextLogModule(BrowsingContext context, LogModule logModule)
{
public Task<Subscription> OnEntryAddedAsync(Func<Log.LogEntry, Task> handler, SubscriptionOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextModule(Broker broker) : Module(broker)
public sealed class BrowsingContextModule(Broker broker) : Module(broker)
{
public async Task<BrowsingContext> CreateAsync(ContextType type, CreateOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
public sealed class BrowsingContextNetworkModule(BrowsingContext context, NetworkModule networkModule)
{
public async Task<Intercept> InterceptRequestAsync(Func<InterceptedRequest, Task> handler, InterceptRequestOptions? options = null)
{
Expand Down Expand Up @@ -134,8 +134,8 @@ public Task<Subscription> OnAuthRequiredAsync(Action<AuthRequiredEventArgs> hand
}
}

public record InterceptRequestOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptRequestOptions : BrowsingContextAddInterceptOptions;

public record InterceptResponseOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptResponseOptions : BrowsingContextAddInterceptOptions;

public record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
public sealed record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
public sealed class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
{
public async Task<PreloadScript> AddPreloadScriptAsync(string functionDeclaration, BrowsingContextAddPreloadScriptOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
public sealed class BrowsingContextStorageModule(BrowsingContext context, StorageModule storageModule)
{
public Task<GetCookiesResult> GetCookiesAsync(GetCookiesOptions? options = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
internal sealed class CaptureScreenshotCommand(CaptureScreenshotCommandParameters @params)
: Command<CaptureScreenshotCommandParameters, CaptureScreenshotResult>(@params, "browsingContext.captureScreenshot");

internal record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;
internal sealed record CaptureScreenshotCommandParameters(BrowsingContext Context, ScreenshotOrigin? Origin, ImageFormat? Format, ClipRectangle? Clip) : CommandParameters;

public record CaptureScreenshotOptions : CommandOptions
public sealed class CaptureScreenshotOptions : CommandOptions
{
public ScreenshotOrigin? Origin { get; set; }

Expand All @@ -52,11 +52,11 @@ public record struct ImageFormat(string Type)
[JsonDerivedType(typeof(ElementClipRectangle), "element")]
public abstract record ClipRectangle;

public record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;
public sealed record BoxClipRectangle(double X, double Y, double Width, double Height) : ClipRectangle;

public record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;
public sealed record ElementClipRectangle(Script.ISharedReference Element) : ClipRectangle;

public record CaptureScreenshotResult(string Data) : EmptyResult
public sealed record CaptureScreenshotResult(string Data) : EmptyResult
{
public static implicit operator byte[](CaptureScreenshotResult captureScreenshotResult) => captureScreenshotResult.ToByteArray();

Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/BrowsingContext/CloseCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CloseCommand(CloseCommandParameters @params)
internal sealed class CloseCommand(CloseCommandParameters @params)
: Command<CloseCommandParameters, EmptyResult>(@params, "browsingContext.close");

internal record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;
internal sealed record CloseCommandParameters(BrowsingContext Context, bool? PromptUnload) : CommandParameters;

public record CloseOptions : CommandOptions
public sealed class CloseOptions : CommandOptions
{
public bool? PromptUnload { get; set; }
}
8 changes: 4 additions & 4 deletions dotnet/src/webdriver/BiDi/BrowsingContext/CreateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class CreateCommand(CreateCommandParameters @params)
internal sealed class CreateCommand(CreateCommandParameters @params)
: Command<CreateCommandParameters, CreateResult>(@params, "browsingContext.create");

internal record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;
internal sealed record CreateCommandParameters(ContextType Type, BrowsingContext? ReferenceContext, bool? Background, Browser.UserContext? UserContext) : CommandParameters;

public record CreateOptions : CommandOptions
public sealed class CreateOptions : CommandOptions
{
public BrowsingContext? ReferenceContext { get; set; }

Expand All @@ -41,4 +41,4 @@ public enum ContextType
Window
}

public record CreateResult(BrowsingContext Context) : EmptyResult;
public sealed record CreateResult(BrowsingContext Context) : EmptyResult;
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/BiDi/BrowsingContext/GetTreeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class GetTreeCommand(GetTreeCommandParameters @params)
internal sealed class GetTreeCommand(GetTreeCommandParameters @params)
: Command<GetTreeCommandParameters, GetTreeResult>(@params, "browsingContext.getTree");

internal record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;
internal sealed record GetTreeCommandParameters(long? MaxDepth, BrowsingContext? Root) : CommandParameters;

public record GetTreeOptions : CommandOptions
public sealed class GetTreeOptions : CommandOptions
{
public GetTreeOptions() { }

Expand All @@ -41,9 +41,9 @@ internal GetTreeOptions(BrowsingContextGetTreeOptions? options)
public BrowsingContext? Root { get; set; }
}

public record BrowsingContextGetTreeOptions
public sealed record BrowsingContextGetTreeOptions
{
public long? MaxDepth { get; set; }
}

public record GetTreeResult(IReadOnlyList<BrowsingContextInfo> Contexts) : EmptyResult;
public sealed record GetTreeResult(IReadOnlyList<BrowsingContextInfo> Contexts) : EmptyResult;
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
internal sealed class HandleUserPromptCommand(HandleUserPromptCommandParameters @params)
: Command<HandleUserPromptCommandParameters, EmptyResult>(@params, "browsingContext.handleUserPrompt");

internal record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;
internal sealed record HandleUserPromptCommandParameters(BrowsingContext Context, bool? Accept, string? UserText) : CommandParameters;

public record HandleUserPromptOptions : CommandOptions
public sealed class HandleUserPromptOptions : CommandOptions
{
public bool? Accept { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

public record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
public sealed record HistoryUpdatedEventArgs(BiDi BiDi, BrowsingContext Context, DateTimeOffset Timestamp, string Url)
: BrowsingContextEventArgs(BiDi, Context);
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

namespace OpenQA.Selenium.BiDi.BrowsingContext;

internal class LocateNodesCommand(LocateNodesCommandParameters @params)
internal sealed class LocateNodesCommand(LocateNodesCommandParameters @params)
: Command<LocateNodesCommandParameters, LocateNodesResult>(@params, "browsingContext.locateNodes");

internal record LocateNodesCommandParameters(BrowsingContext Context, Locator Locator, long? MaxNodeCount, Script.SerializationOptions? SerializationOptions, IEnumerable<Script.ISharedReference>? StartNodes) : CommandParameters;
internal sealed record LocateNodesCommandParameters(BrowsingContext Context, Locator Locator, long? MaxNodeCount, Script.SerializationOptions? SerializationOptions, IEnumerable<Script.ISharedReference>? StartNodes) : CommandParameters;

public record LocateNodesOptions : CommandOptions
public sealed class LocateNodesOptions : CommandOptions
{
public long? MaxNodeCount { get; set; }

Expand All @@ -37,7 +37,7 @@ public record LocateNodesOptions : CommandOptions
public IEnumerable<Script.ISharedReference>? StartNodes { get; set; }
}

public record LocateNodesResult : EmptyResult, IReadOnlyList<Script.NodeRemoteValue>
public sealed record LocateNodesResult : EmptyResult, IReadOnlyList<Script.NodeRemoteValue>
{
private readonly IReadOnlyList<Script.NodeRemoteValue> _nodes;

Expand Down
14 changes: 7 additions & 7 deletions dotnet/src/webdriver/BiDi/BrowsingContext/Locator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ namespace OpenQA.Selenium.BiDi.BrowsingContext;
[JsonDerivedType(typeof(XPathLocator), "xpath")]
public abstract record Locator;

public record AccessibilityLocator(AccessibilityValue Value) : Locator;
public sealed record AccessibilityLocator(AccessibilityValue Value) : Locator;

public record CssLocator(string Value) : Locator;
public sealed record CssLocator(string Value) : Locator;

public record ContextLocator(ContextValue Value) : Locator;
public sealed record ContextLocator(ContextValue Value) : Locator;

public record InnerTextLocator(string Value) : Locator
public sealed record InnerTextLocator(string Value) : Locator
{
public bool? IgnoreCase { get; set; }

Expand All @@ -44,15 +44,15 @@ public record InnerTextLocator(string Value) : Locator
public long? MaxDepth { get; set; }
}

public record XPathLocator(string Value) : Locator;
public sealed record XPathLocator(string Value) : Locator;

public record AccessibilityValue
public sealed record AccessibilityValue
{
public string? Name { get; set; }
public string? Role { get; set; }
}

public record ContextValue(BrowsingContext Context);
public sealed record ContextValue(BrowsingContext Context);

public enum MatchType
{
Expand Down
Loading
Loading