-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into limit-connections
- Loading branch information
Showing
192 changed files
with
4,052 additions
and
1,422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
using System; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi; | ||
|
||
public class BiDiException : Exception | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
using System; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication; | ||
|
||
public record CommandOptions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
.../src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using OpenQA.Selenium.BiDi.Modules.Storage; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable; | ||
|
||
internal class GetCookiesResultConverter : JsonConverter<GetCookiesResult> | ||
{ | ||
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
var doc = JsonDocument.ParseValue(ref reader); | ||
var cookies = doc.RootElement.GetProperty("cookies").Deserialize<IReadOnlyList<Modules.Network.Cookie>>(options); | ||
var partitionKey = doc.RootElement.GetProperty("partitionKey").Deserialize<PartitionKey>(options); | ||
|
||
return new GetCookiesResult(cookies!, partitionKey!); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, GetCookiesResult value, JsonSerializerOptions options) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...t/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using OpenQA.Selenium.BiDi.Modules.Script; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable; | ||
|
||
internal class GetRealmsResultConverter : JsonConverter<GetRealmsResult> | ||
{ | ||
public override GetRealmsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
var doc = JsonDocument.ParseValue(ref reader); | ||
var realms = doc.RootElement.GetProperty("realms").Deserialize<IReadOnlyList<RealmInfo>>(options); | ||
|
||
return new GetRealmsResult(realms!); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, GetRealmsResult value, JsonSerializerOptions options) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using OpenQA.Selenium.BiDi.Modules.Browser; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable; | ||
|
||
internal class GetUserContextsResultConverter : JsonConverter<GetUserContextsResult> | ||
{ | ||
public override GetUserContextsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
var doc = JsonDocument.ParseValue(ref reader); | ||
var userContexts = doc.RootElement.GetProperty("userContexts").Deserialize<IReadOnlyList<UserContextInfo>>(options); | ||
|
||
return new GetUserContextsResult(userContexts!); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, GetUserContextsResult value, JsonSerializerOptions options) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...rc/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using OpenQA.Selenium.BiDi.Modules.Input; | ||
using System; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable; | ||
|
||
internal class InputSourceActionsConverter : JsonConverter<SourceActions> | ||
{ | ||
public override SourceActions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, SourceActions value, JsonSerializerOptions options) | ||
{ | ||
writer.WriteStartObject(); | ||
|
||
writer.WriteString("id", value.Id); | ||
|
||
switch (value) | ||
{ | ||
case KeyActions keys: | ||
writer.WriteString("type", "key"); | ||
writer.WritePropertyName("actions"); | ||
JsonSerializer.Serialize(writer, keys.Actions.Select(a => a as IKeySourceAction), options); | ||
|
||
break; | ||
case PointerActions pointers: | ||
writer.WriteString("type", "pointer"); | ||
if (pointers.Options is not null) | ||
{ | ||
writer.WritePropertyName("parameters"); | ||
JsonSerializer.Serialize(writer, pointers.Options, options); | ||
} | ||
|
||
writer.WritePropertyName("actions"); | ||
JsonSerializer.Serialize(writer, pointers.Actions.Select(a => a as IPointerSourceAction), options); | ||
|
||
break; | ||
case WheelActions wheels: | ||
writer.WriteString("type", "wheel"); | ||
writer.WritePropertyName("actions"); | ||
JsonSerializer.Serialize(writer, wheels.Actions.Select(a => a as IWheelSourceAction), options); | ||
|
||
break; | ||
case NoneActions none: | ||
writer.WriteString("type", "none"); | ||
writer.WritePropertyName("actions"); | ||
JsonSerializer.Serialize(writer, none.Actions.Select(a => a as INoneSourceAction), options); | ||
|
||
break; | ||
} | ||
|
||
writer.WriteEndObject(); | ||
} | ||
} | ||
|
26 changes: 26 additions & 0 deletions
26
...src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using OpenQA.Selenium.BiDi.Modules.BrowsingContext; | ||
using OpenQA.Selenium.BiDi.Modules.Script; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
#nullable enable | ||
|
||
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable; | ||
|
||
internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult> | ||
{ | ||
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
var doc = JsonDocument.ParseValue(ref reader); | ||
var nodes = doc.RootElement.GetProperty("nodes").Deserialize<IReadOnlyList<RemoteValue.Node>>(options); | ||
|
||
return new LocateNodesResult(nodes!); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, LocateNodesResult value, JsonSerializerOptions options) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
Oops, something went wrong.