Skip to content

Commit 38730ca

Browse files
committed
PR feedback
1 parent aff5a6a commit 38730ca

File tree

11 files changed

+191
-191
lines changed

11 files changed

+191
-191
lines changed

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,33 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
3030
[JsonSerializable(typeof(Modules.Script.EvaluateResult.Success))]
3131
[JsonSerializable(typeof(Modules.Script.EvaluateResult.Exception))]
3232

33-
[JsonSerializable(typeof(Modules.Script.RemoteNumberValue), TypeInfoPropertyName = "Script_RemoteValue_Number")]
34-
[JsonSerializable(typeof(Modules.Script.RemoteBooleanValue), TypeInfoPropertyName = "Script_RemoteValue_Boolean")]
35-
[JsonSerializable(typeof(Modules.Script.RemoteBigIntValue), TypeInfoPropertyName = "Script_RemoteValue_BigInt")]
36-
[JsonSerializable(typeof(Modules.Script.RemoteStringValue), TypeInfoPropertyName = "Script_RemoteValue_String")]
37-
[JsonSerializable(typeof(Modules.Script.RemoteNullValue), TypeInfoPropertyName = "Script_RemoteValue_Null")]
38-
[JsonSerializable(typeof(Modules.Script.RemoteUndefinedValue), TypeInfoPropertyName = "Script_RemoteValue_Undefined")]
39-
[JsonSerializable(typeof(Modules.Script.RemoteSymbolValue))]
40-
[JsonSerializable(typeof(Modules.Script.RemoteArrayValue), TypeInfoPropertyName = "Script_RemoteValue_Array")]
41-
[JsonSerializable(typeof(Modules.Script.RemoteObjectValue), TypeInfoPropertyName = "Script_RemoteValue_Object")]
42-
[JsonSerializable(typeof(Modules.Script.RemoteFunctionValue))]
43-
[JsonSerializable(typeof(Modules.Script.RemoteRegExpValue), TypeInfoPropertyName = "Script_RemoteValue_RegExp")]
44-
[JsonSerializable(typeof(Modules.Script.RemoteRegExpValue.RegExpValue), TypeInfoPropertyName = "Script_RemoteValue_RegExp_RegExpValue")]
45-
[JsonSerializable(typeof(Modules.Script.RemoteDateValue), TypeInfoPropertyName = "Script_RemoteValue_Date")]
46-
[JsonSerializable(typeof(Modules.Script.RemoteMapValue), TypeInfoPropertyName = "Script_RemoteValue_Map")]
47-
[JsonSerializable(typeof(Modules.Script.RemoteSetValue), TypeInfoPropertyName = "Script_RemoteValue_Set")]
48-
[JsonSerializable(typeof(Modules.Script.RemoteWeakMapValue))]
49-
[JsonSerializable(typeof(Modules.Script.RemoteWeakSetValue))]
50-
[JsonSerializable(typeof(Modules.Script.RemoteGeneratorValue))]
51-
[JsonSerializable(typeof(Modules.Script.RemoteErrorValue))]
52-
[JsonSerializable(typeof(Modules.Script.RemoteProxyValue))]
53-
[JsonSerializable(typeof(Modules.Script.RemotePromiseValue))]
54-
[JsonSerializable(typeof(Modules.Script.RemoteTypedArrayValue))]
55-
[JsonSerializable(typeof(Modules.Script.RemoteArrayBufferValue))]
56-
[JsonSerializable(typeof(Modules.Script.RemoteNodeListValue))]
57-
[JsonSerializable(typeof(Modules.Script.RemoteHtmlCollectionValue))]
58-
[JsonSerializable(typeof(Modules.Script.RemoteNodeValue))]
59-
[JsonSerializable(typeof(Modules.Script.RemoteWindowProxyValue))]
33+
[JsonSerializable(typeof(Modules.Script.NumberRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Number")]
34+
[JsonSerializable(typeof(Modules.Script.BooleanRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Boolean")]
35+
[JsonSerializable(typeof(Modules.Script.BigIntRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_BigInt")]
36+
[JsonSerializable(typeof(Modules.Script.StringRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_String")]
37+
[JsonSerializable(typeof(Modules.Script.NullRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Null")]
38+
[JsonSerializable(typeof(Modules.Script.UndefinedRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Undefined")]
39+
[JsonSerializable(typeof(Modules.Script.SymbolRemoteValue))]
40+
[JsonSerializable(typeof(Modules.Script.ArrayRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Array")]
41+
[JsonSerializable(typeof(Modules.Script.ObjectRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Object")]
42+
[JsonSerializable(typeof(Modules.Script.FunctionRemoteValue))]
43+
[JsonSerializable(typeof(Modules.Script.RegExpRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_RegExp")]
44+
[JsonSerializable(typeof(Modules.Script.RegExpRemoteValue.RegExpValue), TypeInfoPropertyName = "Script_RemoteValue_RegExp_RegExpValue")]
45+
[JsonSerializable(typeof(Modules.Script.DateRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Date")]
46+
[JsonSerializable(typeof(Modules.Script.MapRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Map")]
47+
[JsonSerializable(typeof(Modules.Script.SetRemoteValue), TypeInfoPropertyName = "Script_RemoteValue_Set")]
48+
[JsonSerializable(typeof(Modules.Script.WeakMapRemoteValue))]
49+
[JsonSerializable(typeof(Modules.Script.WeakSetRemoteValue))]
50+
[JsonSerializable(typeof(Modules.Script.GeneratorRemoteValue))]
51+
[JsonSerializable(typeof(Modules.Script.ErrorRemoteValue))]
52+
[JsonSerializable(typeof(Modules.Script.ProxyRemoteValue))]
53+
[JsonSerializable(typeof(Modules.Script.PromiseRemoteValue))]
54+
[JsonSerializable(typeof(Modules.Script.TypedArrayRemoteValue))]
55+
[JsonSerializable(typeof(Modules.Script.ArrayBufferRemoteValue))]
56+
[JsonSerializable(typeof(Modules.Script.NodeListRemoteValue))]
57+
[JsonSerializable(typeof(Modules.Script.HtmlCollectionRemoteValue))]
58+
[JsonSerializable(typeof(Modules.Script.NodeRemoteValue))]
59+
[JsonSerializable(typeof(Modules.Script.WindowProxyRemoteValue))]
6060

6161
[JsonSerializable(typeof(Modules.Script.RealmInfo.Window))]
6262
[JsonSerializable(typeof(Modules.Script.RealmInfo.DedicatedWorker))]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult>
3131
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
3232
{
3333
using var doc = JsonDocument.ParseValue(ref reader);
34-
var nodes = doc.RootElement.GetProperty("nodes").Deserialize<IReadOnlyList<RemoteNodeValue>>(options);
34+
var nodes = doc.RootElement.GetProperty("nodes").Deserialize<IReadOnlyList<NodeRemoteValue>>(options);
3535

3636
return new LocateNodesResult(nodes!);
3737
}

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,37 +33,37 @@ internal class RemoteValueConverter : JsonConverter<RemoteValue>
3333

3434
if (jsonDocument.RootElement.ValueKind == JsonValueKind.String)
3535
{
36-
return RemoteValue.String(jsonDocument.RootElement.GetString());
36+
return new StringRemoteValue(jsonDocument.RootElement.GetString()!);
3737
}
3838

3939
return jsonDocument.RootElement.GetProperty("type").ToString() switch
4040
{
41-
"number" => jsonDocument.Deserialize<RemoteNumberValue>(options),
42-
"boolean" => jsonDocument.Deserialize<RemoteBooleanValue>(options),
43-
"bigint" => jsonDocument.Deserialize<RemoteBigIntValue>(options),
44-
"string" => jsonDocument.Deserialize<RemoteStringValue>(options),
45-
"null" => jsonDocument.Deserialize<RemoteNullValue>(options),
46-
"undefined" => jsonDocument.Deserialize<RemoteUndefinedValue>(options),
47-
"symbol" => jsonDocument.Deserialize<RemoteSymbolValue>(options),
48-
"array" => jsonDocument.Deserialize<RemoteArrayValue>(options),
49-
"object" => jsonDocument.Deserialize<RemoteObjectValue>(options),
50-
"function" => jsonDocument.Deserialize<RemoteFunctionValue>(options),
51-
"regexp" => jsonDocument.Deserialize<RemoteRegExpValue>(options),
52-
"date" => jsonDocument.Deserialize<RemoteDateValue>(options),
53-
"map" => jsonDocument.Deserialize<RemoteMapValue>(options),
54-
"set" => jsonDocument.Deserialize<RemoteSetValue>(options),
55-
"weakmap" => jsonDocument.Deserialize<RemoteWeakMapValue>(options),
56-
"weakset" => jsonDocument.Deserialize<RemoteWeakSetValue>(options),
57-
"generator" => jsonDocument.Deserialize<RemoteGeneratorValue>(options),
58-
"error" => jsonDocument.Deserialize<RemoteErrorValue>(options),
59-
"proxy" => jsonDocument.Deserialize<RemoteProxyValue>(options),
60-
"promise" => jsonDocument.Deserialize<RemotePromiseValue>(options),
61-
"typedarray" => jsonDocument.Deserialize<RemoteTypedArrayValue>(options),
62-
"arraybuffer" => jsonDocument.Deserialize<RemoteArrayBufferValue>(options),
63-
"nodelist" => jsonDocument.Deserialize<RemoteNodeListValue>(options),
64-
"htmlcollection" => jsonDocument.Deserialize<RemoteHtmlCollectionValue>(options),
65-
"node" => jsonDocument.Deserialize<RemoteNodeValue>(options),
66-
"window" => jsonDocument.Deserialize<RemoteWindowProxyValue>(options),
41+
"number" => jsonDocument.Deserialize<NumberRemoteValue>(options),
42+
"boolean" => jsonDocument.Deserialize<BooleanRemoteValue>(options),
43+
"bigint" => jsonDocument.Deserialize<BigIntRemoteValue>(options),
44+
"string" => jsonDocument.Deserialize<StringRemoteValue>(options),
45+
"null" => jsonDocument.Deserialize<NullRemoteValue>(options),
46+
"undefined" => jsonDocument.Deserialize<UndefinedRemoteValue>(options),
47+
"symbol" => jsonDocument.Deserialize<SymbolRemoteValue>(options),
48+
"array" => jsonDocument.Deserialize<ArrayRemoteValue>(options),
49+
"object" => jsonDocument.Deserialize<ObjectRemoteValue>(options),
50+
"function" => jsonDocument.Deserialize<FunctionRemoteValue>(options),
51+
"regexp" => jsonDocument.Deserialize<RegExpRemoteValue>(options),
52+
"date" => jsonDocument.Deserialize<DateRemoteValue>(options),
53+
"map" => jsonDocument.Deserialize<MapRemoteValue>(options),
54+
"set" => jsonDocument.Deserialize<SetRemoteValue>(options),
55+
"weakmap" => jsonDocument.Deserialize<WeakMapRemoteValue>(options),
56+
"weakset" => jsonDocument.Deserialize<WeakSetRemoteValue>(options),
57+
"generator" => jsonDocument.Deserialize<GeneratorRemoteValue>(options),
58+
"error" => jsonDocument.Deserialize<ErrorRemoteValue>(options),
59+
"proxy" => jsonDocument.Deserialize<ProxyRemoteValue>(options),
60+
"promise" => jsonDocument.Deserialize<PromiseRemoteValue>(options),
61+
"typedarray" => jsonDocument.Deserialize<TypedArrayRemoteValue>(options),
62+
"arraybuffer" => jsonDocument.Deserialize<ArrayBufferRemoteValue>(options),
63+
"nodelist" => jsonDocument.Deserialize<NodeListRemoteValue>(options),
64+
"htmlcollection" => jsonDocument.Deserialize<HtmlCollectionRemoteValue>(options),
65+
"node" => jsonDocument.Deserialize<NodeRemoteValue>(options),
66+
"window" => jsonDocument.Deserialize<WindowProxyRemoteValue>(options),
6767
_ => null,
6868
};
6969
}

dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ public record LocateNodesOptions : CommandOptions
3737
public IEnumerable<Script.ISharedReference>? StartNodes { get; set; }
3838
}
3939

40-
public record LocateNodesResult : IReadOnlyList<Script.RemoteNodeValue>
40+
public record LocateNodesResult : IReadOnlyList<Script.NodeRemoteValue>
4141
{
42-
private readonly IReadOnlyList<Script.RemoteNodeValue> _nodes;
42+
private readonly IReadOnlyList<Script.NodeRemoteValue> _nodes;
4343

44-
internal LocateNodesResult(IReadOnlyList<Script.RemoteNodeValue> nodes)
44+
internal LocateNodesResult(IReadOnlyList<Script.NodeRemoteValue> nodes)
4545
{
4646
_nodes = nodes;
4747
}
4848

49-
public Script.RemoteNodeValue this[int index] => _nodes[index];
49+
public Script.NodeRemoteValue this[int index] => _nodes[index];
5050

5151
public int Count => _nodes.Count;
5252

53-
public IEnumerator<Script.RemoteNodeValue> GetEnumerator() => _nodes.GetEnumerator();
53+
public IEnumerator<Script.NodeRemoteValue> GetEnumerator() => _nodes.GetEnumerator();
5454

5555
IEnumerator IEnumerable.GetEnumerator() => (_nodes as IEnumerable).GetEnumerator();
5656
}

dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public record NodeProperties(long NodeType, long ChildNodeCount)
2828
public IReadOnlyDictionary<string, string>? Attributes { get; internal set; }
2929

3030
[JsonInclude]
31-
public IReadOnlyList<RemoteNodeValue>? Children { get; internal set; }
31+
public IReadOnlyList<NodeRemoteValue>? Children { get; internal set; }
3232

3333
[JsonInclude]
3434
public string? LocalName { get; internal set; }
@@ -43,5 +43,5 @@ public record NodeProperties(long NodeType, long ChildNodeCount)
4343
public string? NodeValue { get; internal set; }
4444

4545
[JsonInclude]
46-
public RemoteNodeValue? ShadowRoot { get; internal set; }
46+
public NodeRemoteValue? ShadowRoot { get; internal set; }
4747
}

0 commit comments

Comments
 (0)