Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion dotnet/src/webdriver/BiDi/Communication/Broker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ internal Broker(BiDi bidi, ITransport transport)
new PrintPageRangeConverter(),
new InputOriginConverter(),
new SubscriptionConverter(),
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase),

// https://github.com/dotnet/runtime/issues/72604
new Json.Converters.Polymorphic.MessageConverter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
using OpenQA.Selenium.BiDi.Modules.Browser;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class GetClientWindowsResultConverter : JsonConverter<GetClientWindowsResult>
{
public override GetClientWindowsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
using OpenQA.Selenium.BiDi.Modules.Storage;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class GetCookiesResultConverter : JsonConverter<GetCookiesResult>
{
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
using OpenQA.Selenium.BiDi.Modules.Script;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class GetRealmsResultConverter : JsonConverter<GetRealmsResult>
{
public override GetRealmsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
using OpenQA.Selenium.BiDi.Modules.Browser;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class GetUserContextsResultConverter : JsonConverter<GetUserContextsResult>
{
public override GetUserContextsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

using OpenQA.Selenium.BiDi.Modules.Input;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class InputSourceActionsConverter : JsonConverter<SourceActions>
{
public override SourceActions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@
using OpenQA.Selenium.BiDi.Modules.Script;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult>
{
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@

using OpenQA.Selenium.BiDi.Modules.Input;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class InputOriginConverter : JsonConverter<Origin>
{
public override Origin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@

using OpenQA.Selenium.BiDi.Modules.Script;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
// https://github.com/dotnet/runtime/issues/72604
internal class EvaluateResultConverter : JsonConverter<EvaluateResult>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

using OpenQA.Selenium.BiDi.Modules.Log;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;

// https://github.com/dotnet/runtime/issues/72604
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class LogEntryConverter : JsonConverter<Modules.Log.Entry>
{
public override Modules.Log.Entry? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
// </copyright>

using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;

// https://github.com/dotnet/runtime/issues/72604
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class MessageConverter : JsonConverter<Message>
{
public override Message? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

using OpenQA.Selenium.BiDi.Modules.Script;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;

// https://github.com/dotnet/runtime/issues/72604
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class RealmInfoConverter : JsonConverter<RealmInfo>
{
public override RealmInfo? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@

using OpenQA.Selenium.BiDi.Modules.Script;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;

// https://github.com/dotnet/runtime/issues/72604
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
internal class RemoteValueConverter : JsonConverter<RemoteValue>
{
public override RemoteValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace OpenQA.Selenium.BiDi.Modules.Browser;

public record ClientWindowInfo([property: JsonPropertyName("active")] bool IsActive, ClientWindow ClientWindow, ClientWindowState State, int Height, int Width, int X, int Y);

[JsonConverter(typeof(JsonStringEnumConverter<ClientWindowState>))]
public enum ClientWindowState
{
Fullscreen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public record CaptureScreenshotOptions : CommandOptions
public ClipRectangle? Clip { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<Origin>))]
public enum Origin
{
Viewport,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

Expand All @@ -35,6 +36,7 @@ public record CreateOptions : CommandOptions
public Browser.UserContext? UserContext { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<ContextType>))]
public enum ContextType
{
Tab,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public record InnerText(string Value) : Locator
public record XPath(string Value) : Locator;
}

[JsonConverter(typeof(JsonStringEnumConverter<MatchType>))]
public enum MatchType
{
Full,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// </copyright>

using OpenQA.Selenium.BiDi.Communication;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

Expand All @@ -31,6 +32,7 @@ public record NavigateOptions : CommandOptions
public ReadinessState? Wait { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<ReadinessState>))]
public enum ReadinessState
{
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using OpenQA.Selenium.BiDi.Communication;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.BrowsingContext;

Expand Down Expand Up @@ -56,6 +57,7 @@ public struct PrintMargin
public double? Top { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<PrintOrientation>))]
public enum PrintOrientation
{
Portrait,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public record UserPromptOpenedEventArgs(BiDi BiDi, BrowsingContext Context, User
public string? DefaultValue { get; internal set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<UserPromptType>))]
public enum UserPromptType
{
Alert,
Expand Down
1 change: 1 addition & 0 deletions dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public record PointerParameters
public PointerType? PointerType { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<PointerType>))]
public enum PointerType
{
Mouse,
Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Log/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Log;

Expand All @@ -38,6 +39,7 @@ public record Javascript(BiDi BiDi, Level Level, Script.Source Source, string Te
: Entry(BiDi, Level, Source, Text, Timestamp);
}

[JsonConverter(typeof(JsonStringEnumConverter<Level>))]
public enum Level
{
Debug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
// under the License.
// </copyright>

using System.Collections.Generic;
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Network;

Expand Down Expand Up @@ -48,6 +49,7 @@ public record BrowsingContextAddInterceptOptions

public record AddInterceptResult(Intercept Intercept);

[JsonConverter(typeof(JsonStringEnumConverter<InterceptPhase>))]
public enum InterceptPhase
{
BeforeRequestSent,
Expand Down
1 change: 1 addition & 0 deletions dotnet/src/webdriver/BiDi/Modules/Network/Cookie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public record Cookie(string Name, BytesValue Value, string Domain, string Path,
public DateTimeOffset? Expiry { get; internal set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<SameSite>))]
public enum SameSite
{
Strict,
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Network/Initiator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// under the License.
// </copyright>

using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Network;

public record Initiator(InitiatorType Type)
Expand All @@ -30,6 +32,7 @@ public record Initiator(InitiatorType Type)
public Request? Request { get; set; }
}

[JsonConverter(typeof(JsonStringEnumConverter<InitiatorType>))]
public enum InitiatorType
{
Parser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
// under the License.
// </copyright>

using System.Collections.Generic;
using OpenQA.Selenium.BiDi.Communication;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Network;

Expand Down Expand Up @@ -47,6 +48,7 @@ public record BrowsingContextSetCacheBehaviorOptions

}

[JsonConverter(typeof(JsonStringEnumConverter<CacheBehavior>))]
public enum CacheBehavior
{
Default,
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
// under the License.
// </copyright>

using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

[JsonConverter(typeof(JsonStringEnumConverter<RealmType>))]
public enum RealmType
{
Window,
Expand Down
1 change: 1 addition & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public record Properties(BrowsingContext.BrowsingContext Context);

public abstract record PrimitiveProtocolRemoteValue : RemoteValue;

[JsonConverter(typeof(JsonStringEnumConverter<Mode>))]
public enum Mode
{
Open,
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/BiDi/Modules/Script/ResultOwnership.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
// under the License.
// </copyright>

using System.Text.Json.Serialization;

namespace OpenQA.Selenium.BiDi.Modules.Script;

[JsonConverter(typeof(JsonStringEnumConverter<ResultOwnership>))]
public enum ResultOwnership
{
Root,
Expand Down
Loading
Loading