Skip to content

Commit 2ce2b06

Browse files
authored
Merge branch 'trunk' into ruby-pagesize-support
2 parents e7091d4 + 2357514 commit 2ce2b06

File tree

59 files changed

+632
-711
lines changed

Some content is hidden

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

59 files changed

+632
-711
lines changed

.bazelrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ try-import %workspace%/.bazelrc.windows.local
88
# https://github.com/bazelbuild/bazel/issues/20369
99
# https://github.com/bazelbuild/bazel/issues/21491
1010

11-
common --enable_bzlmod --lockfile_mode=off
11+
common --lockfile_mode=off
12+
13+
# Prepare for Bazel 8. These become the default in 8.0.0
14+
common --incompatible_disallow_empty_glob
15+
common --incompatible_use_plus_in_repo_names
1216

1317
# Ensure Windows support is accurate.
1418

dotnet/src/support/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ csharp_library(
3131
"*.cs",
3232
"Events/*.cs",
3333
"Extensions/*.cs",
34-
"PageObjects/**/*.cs",
3534
"UI/*.cs",
3635
]) + [":assembly-info"],
3736
out = "WebDriver.Support",
@@ -71,7 +70,6 @@ csharp_library(
7170
"*.cs",
7271
"Events/*.cs",
7372
"Extensions/*.cs",
74-
"PageObjects/**/*.cs",
7573
"UI/*.cs",
7674
]) + [":assembly-info"],
7775
out = "WebDriver.Support.StrongNamed",

dotnet/src/webdriver/CapabilityType.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
// </copyright>
1919

2020
using System.Collections.Generic;
21+
using System.Diagnostics.CodeAnalysis;
22+
23+
#nullable enable
2124

2225
namespace OpenQA.Selenium
2326
{
@@ -167,7 +170,8 @@ public static class CapabilityType
167170
/// </summary>
168171
public static readonly string EnableDownloads = "se:downloadsEnabled";
169172

170-
private static readonly List<string> KnownSpecCompliantCapabilityNames = new List<string>() {
173+
private static readonly HashSet<string> KnownSpecCompliantCapabilityNames = new HashSet<string>()
174+
{
171175
BrowserName,
172176
BrowserVersion,
173177
PlatformName,
@@ -188,8 +192,13 @@ public static class CapabilityType
188192
/// <param name="capabilityName">The name of the capability to check for compliance.</param>
189193
/// <returns><see langword="true"/> if the capability name is valid according to the rules
190194
/// of the specification; otherwise, <see langword="false"/>.</returns>
191-
public static bool IsSpecCompliantCapabilityName(string capabilityName)
195+
public static bool IsSpecCompliantCapabilityName([NotNullWhen(true)] string? capabilityName)
192196
{
197+
if (capabilityName is null)
198+
{
199+
return false;
200+
}
201+
193202
if (KnownSpecCompliantCapabilityNames.Contains(capabilityName) || capabilityName.Contains(":"))
194203
{
195204
return true;

dotnet/src/webdriver/CommandInfo.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
using System;
2121

22+
#nullable enable
23+
2224
namespace OpenQA.Selenium
2325
{
2426
/// <summary>
@@ -45,7 +47,7 @@ public override int GetHashCode()
4547
/// </summary>
4648
/// <param name="obj">The <see cref="CommandInfo"/> to compare to this instance.</param>
4749
/// <returns><see langword="true"/> if <paramref name="obj"/> is a <see cref="CommandInfo"/> and its value is the same as this instance; otherwise, <see langword="false"/>. If <paramref name="obj"/> is <see langword="null"/>, the method returns <see langword="false"/>.</returns>
48-
public override bool Equals(object obj)
50+
public override bool Equals(object? obj)
4951
{
5052
return this.Equals(obj as CommandInfo);
5153
}
@@ -55,15 +57,15 @@ public override bool Equals(object obj)
5557
/// </summary>
5658
/// <param name="other">The <see cref="CommandInfo"/> to compare to this instance.</param>
5759
/// <returns><see langword="true"/> if the value of the <paramref name="other"/> parameter is the same as this instance; otherwise, <see langword="false"/>. If <paramref name="other"/> is <see langword="null"/>, the method returns <see langword="false"/>.</returns>
58-
public bool Equals(CommandInfo other)
60+
public bool Equals(CommandInfo? other)
5961
{
6062
if (other is null)
6163
{
6264
return false;
6365
}
6466

6567
// Optimization for a common success case.
66-
if (Object.ReferenceEquals(this, other))
68+
if (object.ReferenceEquals(this, other))
6769
{
6870
return true;
6971
}
@@ -86,7 +88,7 @@ public bool Equals(CommandInfo other)
8688
/// <param name="left">The first <see cref="CommandInfo"/> object to compare.</param>
8789
/// <param name="right">The second <see cref="CommandInfo"/> object to compare.</param>
8890
/// <returns><see langword="true"/> if the value of <paramref name="left"/> is the same as the value of <paramref name="right"/>; otherwise, <see langword="false"/>.</returns>
89-
public static bool operator ==(CommandInfo left, CommandInfo right)
91+
public static bool operator ==(CommandInfo? left, CommandInfo? right)
9092
{
9193
if (left is null)
9294
{
@@ -107,7 +109,7 @@ public bool Equals(CommandInfo other)
107109
/// <param name="left">The first <see cref="CommandInfo"/> object to compare.</param>
108110
/// <param name="right">The second <see cref="CommandInfo"/> object to compare.</param>
109111
/// <returns><see langword="true"/> if the value of <paramref name="left"/> is different from the value of <paramref name="right"/>; otherwise, <see langword="false"/>.</returns>
110-
public static bool operator !=(CommandInfo left, CommandInfo right)
112+
public static bool operator !=(CommandInfo? left, CommandInfo? right)
111113
{
112114
return !(left == right);
113115
}

dotnet/src/webdriver/DevTools/DevToolsExtensionMethods.cs

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

20+
#nullable enable
21+
2022
namespace OpenQA.Selenium.DevTools
2123
{
2224
/// <summary>

dotnet/src/webdriver/DevTools/DevToolsOptions.cs

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

20+
#nullable enable
21+
2022
namespace OpenQA.Selenium.DevTools
2123
{
2224
/// <summary>

dotnet/src/webdriver/DevTools/DevToolsSessionDomains.cs

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

20+
#nullable enable
21+
2022
namespace OpenQA.Selenium.DevTools
2123
{
2224
/// <summary>
2325
/// Provides an abstract base class for version-specific domain implementations.
2426
/// </summary>
2527
public abstract class DevToolsSessionDomains
2628
{
27-
private CommandResponseTypeMap responseTypeMap = new CommandResponseTypeMap();
28-
2929
/// <summary>
3030
/// Initializes a new instance of the <see cref="DevToolsSessionDomains"/> class.
3131
/// </summary>
@@ -37,7 +37,7 @@ protected DevToolsSessionDomains()
3737
/// <summary>
3838
/// Gets the <see cref="CommandResponseTypeMap"/> containing information about the types returned by DevTools Protocol commands.,
3939
/// </summary>
40-
internal CommandResponseTypeMap ResponseTypeMap => this.responseTypeMap;
40+
internal CommandResponseTypeMap ResponseTypeMap { get; } = new CommandResponseTypeMap();
4141

4242
/// <summary>
4343
/// Populates the command response type map.

dotnet/src/webdriver/DevTools/DevToolsSessionEventReceivedEventArgs.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
using System.Text.Json;
2222
using System.Text.Json.Nodes;
2323

24+
#nullable enable
25+
2426
namespace OpenQA.Selenium.DevTools
2527
{
2628
/// <summary>
@@ -44,16 +46,16 @@ public DevToolsEventReceivedEventArgs(string domainName, string eventName, JsonE
4446
/// <summary>
4547
/// Gets the domain on which the event is to be raised.
4648
/// </summary>
47-
public string DomainName { get; private set; }
49+
public string DomainName { get; }
4850

4951
/// <summary>
5052
/// Gets the name of the event to be raised.
5153
/// </summary>
52-
public string EventName { get; private set; }
54+
public string EventName { get; }
5355

5456
/// <summary>
5557
/// Gets the data with which the event is to be raised.
5658
/// </summary>
57-
public JsonElement EventData { get; private set; }
59+
public JsonElement EventData { get; }
5860
}
5961
}

dotnet/src/webdriver/DevTools/DevToolsSessionLogMessageEventArgs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
using System;
2121

22+
#nullable enable
23+
2224
namespace OpenQA.Selenium.DevTools
2325
{
2426
/// <summary>

dotnet/src/webdriver/DevTools/ExceptionThrownEventArgs.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,34 @@
1919

2020
using System;
2121

22+
#nullable enable
23+
2224
namespace OpenQA.Selenium.DevTools
2325
{
2426
/// <summary>
2527
/// Provides data for events relating to JavaScript exception handling.
2628
/// </summary>
2729
public class ExceptionThrownEventArgs : EventArgs
2830
{
31+
/// <summary>
32+
/// Initializes new instance of the <see cref="ExceptionThrownEventArgs"/> type.
33+
/// </summary>
34+
/// <param name="timestamp">The time stamp of the exception.</param>
35+
/// <param name="message">The text of the exception.</param>
36+
public ExceptionThrownEventArgs(DateTime timestamp, string message)
37+
{
38+
Timestamp = timestamp;
39+
Message = message;
40+
}
41+
2942
/// <summary>
3043
/// Gets the time stamp of the exception.
3144
/// </summary>
32-
public DateTime Timestamp { get; internal set; }
45+
public DateTime Timestamp { get; }
3346

3447
/// <summary>
3548
/// Gets the text of the exception.
3649
/// </summary>
37-
public string Message { get; internal set; }
50+
public string Message { get; }
3851
}
3952
}

0 commit comments

Comments
 (0)