Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public Task<HandleUserPromptResult> HandleUserPromptAsync(HandleUserPromptOption
return BiDi.BrowsingContext.HandleUserPromptAsync(this, options);
}

public Task<GetTreeResult> GetTreeAsync(BrowsingContextGetTreeOptions? options = null)
public Task<GetTreeResult> GetTreeAsync(ContextGetTreeOptions? options = null)
{
GetTreeOptions getTreeOptions = new(options)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ await interception.OnAuthRequiredAsync(
return interception;
}

public Task<AddDataCollectorResult> AddDataCollectorAsync(IEnumerable<DataType> dataTypes, int maxEncodedDataSize, BrowsingContextAddDataCollectorOptions? options = null)
public Task<AddDataCollectorResult> AddDataCollectorAsync(IEnumerable<DataType> dataTypes, int maxEncodedDataSize, ContextAddDataCollectorOptions? options = null)
{
AddDataCollectorOptions addDataCollectorOptions = new(options)
{
Expand All @@ -90,7 +90,7 @@ public Task<AddDataCollectorResult> AddDataCollectorAsync(IEnumerable<DataType>
return networkModule.AddDataCollectorAsync(dataTypes, maxEncodedDataSize, addDataCollectorOptions);
}

public Task<SetCacheBehaviorResult> SetCacheBehaviorAsync(CacheBehavior behavior, BrowsingContextSetCacheBehaviorOptions? options = null)
public Task<SetCacheBehaviorResult> SetCacheBehaviorAsync(CacheBehavior behavior, ContextSetCacheBehaviorOptions? options = null)
{
SetCacheBehaviorOptions setCacheBehaviorOptions = new(options)
{
Expand Down Expand Up @@ -211,8 +211,8 @@ public Task<Subscription> OnAuthRequiredAsync(Action<AuthRequiredEventArgs> hand
}
}

public sealed record InterceptRequestOptions : BrowsingContextAddInterceptOptions;
public sealed class InterceptRequestOptions : ContextAddInterceptOptions;

public sealed record InterceptResponseOptions : BrowsingContextAddInterceptOptions;
public sealed class InterceptResponseOptions : ContextAddInterceptOptions;

public sealed record InterceptAuthOptions : BrowsingContextAddInterceptOptions;
public sealed class InterceptAuthOptions : ContextAddInterceptOptions;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace OpenQA.Selenium.BiDi.BrowsingContext;

public sealed class BrowsingContextScriptModule(BrowsingContext context, ScriptModule scriptModule)
{
public async Task<AddPreloadScriptResult> AddPreloadScriptAsync([StringSyntax(StringSyntaxConstants.JavaScript)] string functionDeclaration, BrowsingContextAddPreloadScriptOptions? options = null)
public async Task<AddPreloadScriptResult> AddPreloadScriptAsync([StringSyntax(StringSyntaxConstants.JavaScript)] string functionDeclaration, ContextAddPreloadScriptOptions? options = null)
{
AddPreloadScriptOptions addPreloadScriptOptions = new(options)
{
Expand Down
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 @@ -26,21 +26,21 @@ internal sealed class GetTreeCommand(GetTreeParameters @params)

internal sealed record GetTreeParameters(long? MaxDepth, BrowsingContext? Root) : Parameters;

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

internal GetTreeOptions(BrowsingContextGetTreeOptions? options)
internal GetTreeOptions(ContextGetTreeOptions? options)
: this()
{
MaxDepth = options?.MaxDepth;
Timeout = options?.Timeout;
}

public long? MaxDepth { get; set; }

public BrowsingContext? Root { get; set; }
}

public sealed record BrowsingContextGetTreeOptions
public sealed class ContextGetTreeOptions : CommandOptions
{
public long? MaxDepth { get; set; }
}
Expand Down
7 changes: 4 additions & 3 deletions dotnet/src/webdriver/BiDi/Network/AddDataCollectorCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ internal sealed class AddDataCollectorCommand(AddDataCollectorParameters @params

internal sealed record AddDataCollectorParameters(IEnumerable<DataType> DataTypes, int MaxEncodedDataSize, CollectorType? CollectorType, IEnumerable<BrowsingContext.BrowsingContext>? Contexts, IEnumerable<Browser.UserContext>? UserContexts) : Parameters;

public class AddDataCollectorOptions() : CommandOptions
public sealed class AddDataCollectorOptions() : CommandOptions
{
internal AddDataCollectorOptions(BrowsingContextAddDataCollectorOptions? options) : this()
internal AddDataCollectorOptions(ContextAddDataCollectorOptions? options) : this()
{
CollectorType = options?.CollectorType;
UserContexts = options?.UserContexts;
Timeout = options?.Timeout;
}

public CollectorType? CollectorType { get; set; }
Expand All @@ -43,7 +44,7 @@ internal AddDataCollectorOptions(BrowsingContextAddDataCollectorOptions? options
public IEnumerable<Browser.UserContext>? UserContexts { get; set; }
}

public class BrowsingContextAddDataCollectorOptions
public sealed class ContextAddDataCollectorOptions : CommandOptions
{
public CollectorType? CollectorType { get; set; }

Expand Down
9 changes: 4 additions & 5 deletions dotnet/src/webdriver/BiDi/Network/AddInterceptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ internal sealed class AddInterceptCommand(AddInterceptParameters @params)

internal sealed record AddInterceptParameters(IEnumerable<InterceptPhase> Phases, IEnumerable<BrowsingContext.BrowsingContext>? Contexts, IEnumerable<UrlPattern>? UrlPatterns) : Parameters;

public class AddInterceptOptions : CommandOptions
public class AddInterceptOptions() : CommandOptions
{
public AddInterceptOptions() { }

internal AddInterceptOptions(BrowsingContextAddInterceptOptions? options)
internal AddInterceptOptions(ContextAddInterceptOptions? options) : this()
{
UrlPatterns = options?.UrlPatterns;
Timeout = options?.Timeout;
}

public IEnumerable<BrowsingContext.BrowsingContext>? Contexts { get; set; }

public IEnumerable<UrlPattern>? UrlPatterns { get; set; }
}

public record BrowsingContextAddInterceptOptions
public class ContextAddInterceptOptions : CommandOptions
{
public IEnumerable<UrlPattern>? UrlPatterns { get; set; }
}
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/BiDi/Network/SetCacheBehaviorCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ internal sealed record SetCacheBehaviorParameters(CacheBehavior CacheBehavior, I

public sealed class SetCacheBehaviorOptions() : CommandOptions
{
internal SetCacheBehaviorOptions(BrowsingContextSetCacheBehaviorOptions? options) : this()
internal SetCacheBehaviorOptions(ContextSetCacheBehaviorOptions? options) : this()
Comment thread
nvborisenko marked this conversation as resolved.
Outdated
{

Timeout = options?.Timeout;
}

public IEnumerable<BrowsingContext.BrowsingContext>? Contexts { get; set; }
}

public sealed record BrowsingContextSetCacheBehaviorOptions;
public sealed class ContextSetCacheBehaviorOptions : CommandOptions;

[JsonConverter(typeof(CamelCaseEnumConverter<CacheBehavior>))]
public enum CacheBehavior
Expand Down
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/BiDi/Script/AddPreloadScriptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ internal sealed class AddPreloadScriptCommand(AddPreloadScriptParameters @params

internal sealed record AddPreloadScriptParameters([StringSyntax(StringSyntaxConstants.JavaScript)] string FunctionDeclaration, IEnumerable<ChannelLocalValue>? Arguments, IEnumerable<BrowsingContext.BrowsingContext>? Contexts, string? Sandbox) : Parameters;

public sealed class AddPreloadScriptOptions : CommandOptions
public sealed class AddPreloadScriptOptions() : CommandOptions
{
public AddPreloadScriptOptions() { }

internal AddPreloadScriptOptions(BrowsingContextAddPreloadScriptOptions? options)
internal AddPreloadScriptOptions(ContextAddPreloadScriptOptions? options)
: this()
{
Arguments = options?.Arguments;
Sandbox = options?.Sandbox;
Timeout = options?.Timeout;
}

public IEnumerable<ChannelLocalValue>? Arguments { get; set; }
Expand All @@ -44,7 +44,7 @@ internal AddPreloadScriptOptions(BrowsingContextAddPreloadScriptOptions? options
public string? Sandbox { get; set; }
}

public sealed record BrowsingContextAddPreloadScriptOptions
public sealed class ContextAddPreloadScriptOptions : CommandOptions
{
public IEnumerable<ChannelLocalValue>? Arguments { get; set; }

Expand Down