Skip to content

Commit 0af4a58

Browse files
authored
Merge branch 'trunk' into alert_tests
2 parents f2bcace + 12a1593 commit 0af4a58

File tree

50 files changed

+1467
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1467
-266
lines changed

.readthedocs.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

common/src/web/formPage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@
8282

8383
<select id="invisible_multi_select" multiple>
8484
<option selected="selected" value="apples" style="opacity: 0;">Apples</option>
85-
<option value="oranges">Oranges</option>
86-
<option selected="selected" value="lemons">Lemons</option>
85+
<option value="pears" style="opacity: 0.0;">Pears</option>
86+
<option value="oranges" style="display: none;">Oranges</option>
87+
<option selected="selected" value="lemons" style="visibility: hidden;">Lemons</option>
8788
</select>
8889

8990
<select name="select-default">

dotnet/src/webdriver/BiDi/Communication/Broker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ internal Broker(BiDi bidi, Uri url)
7676
new BrowserClientWindowConverter(),
7777
new NavigationConverter(),
7878
new InterceptConverter(_bidi),
79-
new RequestConverter(_bidi),
79+
new RequestConverter(),
8080
new ChannelConverter(),
8181
new HandleConverter(_bidi),
8282
new InternalIdConverter(_bidi),

dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
6262
[JsonSerializable(typeof(Modules.Script.AudioWorkletRealmInfo))]
6363
[JsonSerializable(typeof(Modules.Script.WorkletRealmInfo))]
6464

65+
[JsonSerializable(typeof(Modules.Log.GenericLogEntry))]
6566
[JsonSerializable(typeof(Modules.Log.ConsoleLogEntry))]
6667
[JsonSerializable(typeof(Modules.Log.JavascriptLogEntry))]
6768
#endregion

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.Browser;
2122
using System;
2223
using System.Collections.Generic;
@@ -30,7 +31,7 @@ internal class GetClientWindowsResultConverter : JsonConverter<GetClientWindowsR
3031
public override GetClientWindowsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3132
{
3233
using var doc = JsonDocument.ParseValue(ref reader);
33-
var clientWindows = doc.RootElement.GetProperty("clientWindows").Deserialize<IReadOnlyList<ClientWindowInfo>>(options);
34+
var clientWindows = doc.RootElement.GetProperty("clientWindows").Deserialize(options.GetTypeInfo<IReadOnlyList<ClientWindowInfo>>());
3435

3536
return new GetClientWindowsResult(clientWindows!);
3637
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.Storage;
2122
using System;
2223
using System.Collections.Generic;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
26+
using System.Text.Json.Serialization.Metadata;
2527

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

@@ -30,8 +32,8 @@ internal class GetCookiesResultConverter : JsonConverter<GetCookiesResult>
3032
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3133
{
3234
using var doc = JsonDocument.ParseValue(ref reader);
33-
var cookies = doc.RootElement.GetProperty("cookies").Deserialize<IReadOnlyList<Modules.Network.Cookie>>(options);
34-
var partitionKey = doc.RootElement.GetProperty("partitionKey").Deserialize<PartitionKey>(options);
35+
var cookies = doc.RootElement.GetProperty("cookies").Deserialize(options.GetTypeInfo<IReadOnlyList<Modules.Network.Cookie>>());
36+
var partitionKey = doc.RootElement.GetProperty("partitionKey").Deserialize((JsonTypeInfo<PartitionKey>)options.GetTypeInfo(typeof(PartitionKey)));
3537

3638
return new GetCookiesResult(cookies!, partitionKey!);
3739
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.Script;
2122
using System;
2223
using System.Collections.Generic;
@@ -30,7 +31,7 @@ internal class GetRealmsResultConverter : JsonConverter<GetRealmsResult>
3031
public override GetRealmsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3132
{
3233
using var doc = JsonDocument.ParseValue(ref reader);
33-
var realms = doc.RootElement.GetProperty("realms").Deserialize<IReadOnlyList<RealmInfo>>(options);
34+
var realms = doc.RootElement.GetProperty("realms").Deserialize(options.GetTypeInfo<IReadOnlyList<RealmInfo>>());
3435

3536
return new GetRealmsResult(realms!);
3637
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.Browser;
2122
using System;
2223
using System.Collections.Generic;
@@ -30,7 +31,7 @@ internal class GetUserContextsResultConverter : JsonConverter<GetUserContextsRes
3031
public override GetUserContextsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3132
{
3233
using var doc = JsonDocument.ParseValue(ref reader);
33-
var userContexts = doc.RootElement.GetProperty("userContexts").Deserialize<IReadOnlyList<UserContextInfo>>(options);
34+
var userContexts = doc.RootElement.GetProperty("userContexts").Deserialize(options.GetTypeInfo<IReadOnlyList<UserContextInfo>>());
3435

3536
return new GetUserContextsResult(userContexts!);
3637
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.Input;
2122
using System;
23+
using System.Collections.Generic;
2224
using System.Linq;
2325
using System.Text.Json;
2426
using System.Text.Json.Serialization;
@@ -43,31 +45,31 @@ public override void Write(Utf8JsonWriter writer, SourceActions value, JsonSeria
4345
case KeyActions keys:
4446
writer.WriteString("type", "key");
4547
writer.WritePropertyName("actions");
46-
JsonSerializer.Serialize(writer, keys.Actions.Select(a => a as IKeySourceAction), options);
48+
JsonSerializer.Serialize(writer, keys.Actions.Select(a => a as IKeySourceAction), options.GetTypeInfo<IEnumerable<IKeySourceAction?>>());
4749

4850
break;
4951
case PointerActions pointers:
5052
writer.WriteString("type", "pointer");
5153
if (pointers.Options is not null)
5254
{
5355
writer.WritePropertyName("parameters");
54-
JsonSerializer.Serialize(writer, pointers.Options, options);
56+
JsonSerializer.Serialize(writer, pointers.Options, options.GetTypeInfo(typeof(PointerParameters)));
5557
}
5658

5759
writer.WritePropertyName("actions");
58-
JsonSerializer.Serialize(writer, pointers.Actions.Select(a => a as IPointerSourceAction), options);
60+
JsonSerializer.Serialize(writer, pointers.Actions.Select(a => a as IPointerSourceAction), options.GetTypeInfo<IEnumerable<IPointerSourceAction?>>());
5961

6062
break;
6163
case WheelActions wheels:
6264
writer.WriteString("type", "wheel");
6365
writer.WritePropertyName("actions");
64-
JsonSerializer.Serialize(writer, wheels.Actions.Select(a => a as IWheelSourceAction), options);
66+
JsonSerializer.Serialize(writer, wheels.Actions.Select(a => a as IWheelSourceAction), options.GetTypeInfo<IEnumerable<IWheelSourceAction?>>());
6567

6668
break;
6769
case NoneActions none:
6870
writer.WriteString("type", "none");
6971
writer.WritePropertyName("actions");
70-
JsonSerializer.Serialize(writer, none.Actions.Select(a => a as INoneSourceAction), options);
72+
JsonSerializer.Serialize(writer, none.Actions.Select(a => a as INoneSourceAction), options.GetTypeInfo<IEnumerable<INoneSourceAction?>>());
7173

7274
break;
7375
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// under the License.
1818
// </copyright>
1919

20+
using OpenQA.Selenium.BiDi.Communication.Json.Internal;
2021
using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
2122
using OpenQA.Selenium.BiDi.Modules.Script;
2223
using System;
@@ -31,7 +32,7 @@ internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult>
3132
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3233
{
3334
using var doc = JsonDocument.ParseValue(ref reader);
34-
var nodes = doc.RootElement.GetProperty("nodes").Deserialize<IReadOnlyList<NodeRemoteValue>>(options);
35+
var nodes = doc.RootElement.GetProperty("nodes").Deserialize(options.GetTypeInfo<IReadOnlyList<NodeRemoteValue>>());
3536

3637
return new LocateNodesResult(nodes!);
3738
}

0 commit comments

Comments
 (0)