Skip to content

Commit 94d9f9e

Browse files
committed
Move Input
1 parent d1eb321 commit 94d9f9e

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,12 @@
2222

2323
namespace OpenQA.Selenium.BiDi.Communication.Json;
2424

25-
#region https://github.com/dotnet/runtime/issues/72604
26-
[JsonSerializable(typeof(Log.GenericLogEntry))]
27-
[JsonSerializable(typeof(Log.ConsoleLogEntry))]
28-
[JsonSerializable(typeof(Log.JavascriptLogEntry))]
29-
#endregion
25+
3026

3127
[JsonSerializable(typeof(Command))]
3228
[JsonSerializable(typeof(EmptyResult))]
3329

34-
[JsonSerializable(typeof(Input.PerformActionsCommand))]
35-
[JsonSerializable(typeof(Input.ReleaseActionsCommand))]
36-
[JsonSerializable(typeof(Input.SetFilesCommand))]
37-
[JsonSerializable(typeof(IEnumerable<Input.IPointerSourceAction>))]
38-
[JsonSerializable(typeof(IEnumerable<Input.IKeySourceAction>))]
39-
[JsonSerializable(typeof(IEnumerable<Input.INoneSourceAction>))]
40-
[JsonSerializable(typeof(IEnumerable<Input.IWheelSourceAction>))]
30+
4131

4232

4333
internal partial class BiDiJsonSerializerContext : JsonSerializerContext;

dotnet/src/webdriver/BiDi/Input/InputModule.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// </copyright>
1919

2020
using OpenQA.Selenium.BiDi.Communication;
21-
using OpenQA.Selenium.BiDi.Communication.Json;
2221
using System.Collections.Generic;
2322
using System.Text.Json;
2423
using System.Text.Json.Serialization;
@@ -28,7 +27,7 @@ namespace OpenQA.Selenium.BiDi.Input;
2827

2928
public sealed class InputModule : Module
3029
{
31-
private JsonSerializerContext _jsonContext = null!;
30+
private InputModuleJsonSerializerContext _jsonContext = null!;
3231

3332
public async Task<EmptyResult> PerformActionsAsync(BrowsingContext.BrowsingContext context, IEnumerable<SourceActions> actions, PerformActionsOptions? options = null)
3433
{
@@ -53,6 +52,19 @@ public async Task<EmptyResult> SetFilesAsync(BrowsingContext.BrowsingContext con
5352

5453
protected internal override void Initialize(JsonSerializerOptions options)
5554
{
56-
_jsonContext = new BiDiJsonSerializerContext(options);
55+
_jsonContext = new(options);
5756
}
5857
}
58+
59+
[JsonSerializable(typeof(Command))]
60+
[JsonSerializable(typeof(EmptyResult))]
61+
62+
[JsonSerializable(typeof(PerformActionsCommand))]
63+
[JsonSerializable(typeof(ReleaseActionsCommand))]
64+
[JsonSerializable(typeof(SetFilesCommand))]
65+
[JsonSerializable(typeof(IEnumerable<IPointerSourceAction>))]
66+
[JsonSerializable(typeof(IEnumerable<IKeySourceAction>))]
67+
[JsonSerializable(typeof(IEnumerable<INoneSourceAction>))]
68+
[JsonSerializable(typeof(IEnumerable<IWheelSourceAction>))]
69+
70+
internal partial class InputModuleJsonSerializerContext : JsonSerializerContext;

dotnet/src/webdriver/BiDi/Log/LogModule.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ protected internal override void Initialize(JsonSerializerOptions options)
4545
}
4646
}
4747

48+
#region https://github.com/dotnet/runtime/issues/72604
49+
[JsonSerializable(typeof(GenericLogEntry))]
50+
[JsonSerializable(typeof(ConsoleLogEntry))]
51+
[JsonSerializable(typeof(JavascriptLogEntry))]
52+
#endregion
53+
4854
[JsonSerializable(typeof(Command))]
4955
[JsonSerializable(typeof(EmptyResult))]
5056

0 commit comments

Comments
 (0)