Skip to content

Commit f83ad29

Browse files
authored
Merge branch 'trunk' into async-http-client
2 parents 86fc08a + f391cd0 commit f83ad29

File tree

206 files changed

+4229
-1444
lines changed

Some content is hidden

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

206 files changed

+4229
-1444
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ maven.install(
173173
"com.github.spotbugs:spotbugs:4.8.6",
174174
"com.github.stephenc.jcip:jcip-annotations:1.0-1",
175175
"com.google.code.gson:gson:2.11.0",
176-
"com.google.guava:guava:33.3.0-jre",
176+
"com.google.guava:guava:33.3.1-jre",
177177
"com.google.auto:auto-common:1.2.2",
178178
"com.google.auto.service:auto-service:1.1.1",
179179
"com.google.auto.service:auto-service-annotations:1.1.1",

dotnet/src/webdriver/BiDi/BiDi.cs

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Threading.Tasks;
43
using OpenQA.Selenium.BiDi.Communication;
54
using OpenQA.Selenium.BiDi.Communication.Transport;
65

6+
#nullable enable
7+
78
namespace OpenQA.Selenium.BiDi;
89

910
public class BiDi : IAsyncDisposable
@@ -38,11 +39,11 @@ internal BiDi(string url)
3839
}
3940

4041
internal Modules.Session.SessionModule SessionModule => _sessionModule.Value;
41-
internal Modules.BrowsingContext.BrowsingContextModule BrowsingContextModule => _browsingContextModule.Value;
42+
internal Modules.BrowsingContext.BrowsingContextModule BrowsingContext => _browsingContextModule.Value;
4243
public Modules.Browser.BrowserModule Browser => _browserModule.Value;
4344
public Modules.Network.NetworkModule Network => _networkModule.Value;
4445
internal Modules.Input.InputModule InputModule => _inputModule.Value;
45-
internal Modules.Script.ScriptModule ScriptModule => _scriptModule.Value;
46+
public Modules.Script.ScriptModule Script => _scriptModule.Value;
4647
public Modules.Log.LogModule Log => _logModule.Value;
4748
public Modules.Storage.StorageModule Storage => _storageModule.Value;
4849

@@ -60,16 +61,6 @@ public static async Task<BiDi> ConnectAsync(string url)
6061
return bidi;
6162
}
6263

63-
public Task<Modules.BrowsingContext.BrowsingContext> CreateContextAsync(Modules.BrowsingContext.ContextType type, Modules.BrowsingContext.CreateOptions? options = null)
64-
{
65-
return BrowsingContextModule.CreateAsync(type, options);
66-
}
67-
68-
public Task<IReadOnlyList<Modules.BrowsingContext.BrowsingContextInfo>> GetTreeAsync(Modules.BrowsingContext.GetTreeOptions? options = null)
69-
{
70-
return BrowsingContextModule.GetTreeAsync(options);
71-
}
72-
7364
public Task EndAsync(Modules.Session.EndOptions? options = null)
7465
{
7566
return SessionModule.EndAsync(options);
@@ -81,44 +72,4 @@ public async ValueTask DisposeAsync()
8172

8273
_transport?.Dispose();
8374
}
84-
85-
public Task<Subscription> OnContextCreatedAsync(Func<Modules.BrowsingContext.BrowsingContextInfo, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
86-
{
87-
return BrowsingContextModule.OnContextCreatedAsync(handler, options);
88-
}
89-
90-
public Task<Subscription> OnContextCreatedAsync(Action<Modules.BrowsingContext.BrowsingContextInfo> handler, BrowsingContextsSubscriptionOptions? options = null)
91-
{
92-
return BrowsingContextModule.OnContextCreatedAsync(handler, options);
93-
}
94-
95-
public Task<Subscription> OnContextDestroyedAsync(Func<Modules.BrowsingContext.BrowsingContextInfo, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
96-
{
97-
return BrowsingContextModule.OnContextDestroyedAsync(handler, options);
98-
}
99-
100-
public Task<Subscription> OnContextDestroyedAsync(Action<Modules.BrowsingContext.BrowsingContextInfo> handler, BrowsingContextsSubscriptionOptions? options = null)
101-
{
102-
return BrowsingContextModule.OnContextDestroyedAsync(handler, options);
103-
}
104-
105-
public Task<Subscription> OnUserPromptOpenedAsync(Func<Modules.BrowsingContext.UserPromptOpenedEventArgs, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
106-
{
107-
return BrowsingContextModule.OnUserPromptOpenedAsync(handler, options);
108-
}
109-
110-
public Task<Subscription> OnUserPromptOpenedAsync(Action<Modules.BrowsingContext.UserPromptOpenedEventArgs> handler, BrowsingContextsSubscriptionOptions? options = null)
111-
{
112-
return BrowsingContextModule.OnUserPromptOpenedAsync(handler, options);
113-
}
114-
115-
public Task<Subscription> OnUserPromptClosedAsync(Func<Modules.BrowsingContext.UserPromptClosedEventArgs, Task> handler, BrowsingContextsSubscriptionOptions? options = null)
116-
{
117-
return BrowsingContextModule.OnUserPromptClosedAsync(handler, options);
118-
}
119-
120-
public Task<Subscription> OnUserPromptClosedAsync(Action<Modules.BrowsingContext.UserPromptClosedEventArgs> handler, BrowsingContextsSubscriptionOptions? options = null)
121-
{
122-
return BrowsingContextModule.OnUserPromptClosedAsync(handler, options);
123-
}
12475
}

dotnet/src/webdriver/BiDi/BiDiException.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22

3+
#nullable enable
4+
35
namespace OpenQA.Selenium.BiDi;
46

57
public class BiDiException : Exception

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
using System.Threading;
1111
using System.Threading.Tasks;
1212

13+
#nullable enable
14+
1315
namespace OpenQA.Selenium.BiDi.Communication;
1416

1517
public class Broker : IAsyncDisposable
@@ -34,7 +36,7 @@ public class Broker : IAsyncDisposable
3436

3537
private readonly JsonSerializerOptions _jsonSerializerOptions;
3638

37-
public Broker(BiDi bidi, ITransport transport)
39+
internal Broker(BiDi bidi, ITransport transport)
3840
{
3941
_bidi = bidi;
4042
_transport = transport;
@@ -51,14 +53,15 @@ public Broker(BiDi bidi, ITransport transport)
5153
new NavigationConverter(),
5254
new InterceptConverter(_bidi),
5355
new RequestConverter(_bidi),
54-
new ChannelConverter(_bidi),
56+
new ChannelConverter(),
5557
new HandleConverter(_bidi),
5658
new InternalIdConverter(_bidi),
5759
new PreloadScriptConverter(_bidi),
5860
new RealmConverter(_bidi),
5961
new RealmTypeConverter(),
6062
new DateTimeOffsetConverter(),
6163
new PrintPageRangeConverter(),
64+
new InputOriginConverter(),
6265
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase),
6366

6467
// https://github.com/dotnet/runtime/issues/72604
@@ -68,6 +71,13 @@ public Broker(BiDi bidi, ITransport transport)
6871
new Json.Converters.Polymorphic.RealmInfoConverter(),
6972
new Json.Converters.Polymorphic.LogEntryConverter(),
7073
//
74+
75+
// Enumerable
76+
new Json.Converters.Enumerable.GetCookiesResultConverter(),
77+
new Json.Converters.Enumerable.LocateNodesResultConverter(),
78+
new Json.Converters.Enumerable.InputSourceActionsConverter(),
79+
new Json.Converters.Enumerable.GetUserContextsResultConverter(),
80+
new Json.Converters.Enumerable.GetRealmsResultConverter(),
7181
}
7282
};
7383
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Text.Json.Serialization;
22

3+
#nullable enable
4+
35
namespace OpenQA.Selenium.BiDi.Communication;
46

57
[JsonPolymorphic(TypeDiscriminatorPropertyName = "method")]

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22

3+
#nullable enable
4+
35
namespace OpenQA.Selenium.BiDi.Communication;
46

57
public record CommandOptions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Collections.Generic;
44
using System.Threading.Tasks;
55

6+
#nullable enable
7+
68
namespace OpenQA.Selenium.BiDi.Communication;
79

810
public abstract class EventHandler(string eventName, Type eventArgsType, IEnumerable<BrowsingContext>? contexts = null)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Text.Json;
44
using System.Text.Json.Serialization;
55

6+
#nullable enable
7+
68
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
79

810
internal class BrowserUserContextConverter : JsonConverter<UserContext>

dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using System.Text.Json;
44
using System.Text.Json.Serialization;
55

6+
#nullable enable
7+
68
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
79

810
internal class BrowsingContextConverter : JsonConverter<BrowsingContext>

dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,17 @@
33
using System.Text.Json;
44
using System.Text.Json.Serialization;
55

6+
#nullable enable
7+
68
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
79

810
internal class ChannelConverter : JsonConverter<Channel>
911
{
10-
private readonly BiDi _bidi;
11-
12-
public ChannelConverter(BiDi bidi)
13-
{
14-
_bidi = bidi;
15-
}
16-
1712
public override Channel? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1813
{
1914
var id = reader.GetString();
2015

21-
return new Channel(_bidi, id!);
16+
return new Channel(id!);
2217
}
2318

2419
public override void Write(Utf8JsonWriter writer, Channel value, JsonSerializerOptions options)

0 commit comments

Comments
 (0)