Skip to content

Commit 3a921ac

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into node-max-sessions-improvement
2 parents 5c5033c + 2eceb90 commit 3a921ac

File tree

4 files changed

+1
-44
lines changed

4 files changed

+1
-44
lines changed

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -276,27 +276,7 @@ public async Task UnsubscribeAsync(Session.Subscription subscription, EventHandl
276276

277277
eventHandlers.Remove(eventHandler);
278278

279-
if (subscription is not null)
280-
{
281-
await _bidi.SessionModule.UnsubscribeAsync([subscription]).ConfigureAwait(false);
282-
}
283-
else
284-
{
285-
if (eventHandler.Contexts is not null)
286-
{
287-
if (!eventHandlers.Any(h => eventHandler.Contexts.Equals(h.Contexts)) && !eventHandlers.Any(h => h.Contexts is null))
288-
{
289-
await _bidi.SessionModule.UnsubscribeAsync([eventHandler.EventName], new() { Contexts = eventHandler.Contexts }).ConfigureAwait(false);
290-
}
291-
}
292-
else
293-
{
294-
if (!eventHandlers.Any(h => h.Contexts is not null) && !eventHandlers.Any(h => h.Contexts is null))
295-
{
296-
await _bidi.SessionModule.UnsubscribeAsync([eventHandler.EventName]).ConfigureAwait(false);
297-
}
298-
}
299-
}
279+
await _bidi.SessionModule.UnsubscribeAsync([subscription]).ConfigureAwait(false);
300280
}
301281

302282
public async ValueTask DisposeAsync()

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
7878
[JsonSerializable(typeof(Session.SubscribeCommand))]
7979
[JsonSerializable(typeof(Session.SubscribeResult))]
8080
[JsonSerializable(typeof(Session.UnsubscribeByIdCommand))]
81-
[JsonSerializable(typeof(Session.UnsubscribeByAttributesCommand))]
8281

8382
[JsonSerializable(typeof(Browser.CloseCommand), TypeInfoPropertyName = "Browser_CloseCommand")]
8483
[JsonSerializable(typeof(Browser.CreateUserContextCommand))]

dotnet/src/webdriver/BiDi/Session/SessionModule.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ public async Task<EmptyResult> UnsubscribeAsync(IEnumerable<Subscription> subscr
4444
return await Broker.ExecuteCommandAsync<UnsubscribeByIdCommand, EmptyResult>(new UnsubscribeByIdCommand(@params), options).ConfigureAwait(false);
4545
}
4646

47-
public async Task<EmptyResult> UnsubscribeAsync(IEnumerable<string> eventNames, UnsubscribeByAttributesOptions? options = null)
48-
{
49-
var @params = new UnsubscribeByAttributesParameters(eventNames, options?.Contexts);
50-
51-
return await Broker.ExecuteCommandAsync<UnsubscribeByAttributesCommand, EmptyResult>(new UnsubscribeByAttributesCommand(@params), options).ConfigureAwait(false);
52-
}
53-
5447
public async Task<NewResult> NewAsync(CapabilitiesRequest capabilitiesRequest, NewOptions? options = null)
5548
{
5649
var @params = new NewParameters(capabilitiesRequest);

dotnet/src/webdriver/BiDi/Session/UnsubscribeCommand.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,13 @@
1818
// </copyright>
1919

2020
using OpenQA.Selenium.BiDi.Communication;
21-
using System;
2221
using System.Collections.Generic;
2322

2423
namespace OpenQA.Selenium.BiDi.Session;
2524

2625
internal sealed class UnsubscribeByIdCommand(UnsubscribeByIdParameters @params)
2726
: Command<UnsubscribeByIdParameters, EmptyResult>(@params, "session.unsubscribe");
2827

29-
internal sealed class UnsubscribeByAttributesCommand(UnsubscribeByAttributesParameters @params)
30-
: Command<UnsubscribeByAttributesParameters, EmptyResult>(@params, "session.unsubscribe");
31-
3228
internal sealed record UnsubscribeByIdParameters(IEnumerable<Subscription> Subscriptions) : Parameters;
3329

3430
public sealed class UnsubscribeByIdOptions : CommandOptions;
35-
36-
internal sealed record UnsubscribeByAttributesParameters(
37-
IEnumerable<string> Events,
38-
[property: Obsolete("Contexts param is deprecated and will be removed in the future versions")]
39-
// https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByAttributesRequest
40-
IEnumerable<BrowsingContext.BrowsingContext>? Contexts) : Parameters;
41-
42-
public sealed class UnsubscribeByAttributesOptions : CommandOptions
43-
{
44-
public IEnumerable<BrowsingContext.BrowsingContext>? Contexts { get; set; }
45-
}

0 commit comments

Comments
 (0)