Skip to content

Commit 63e5c72

Browse files
authored
Merge branch 'trunk' into java-for-loop-enhance
2 parents 3137ea1 + e6d6e0b commit 63e5c72

File tree

41 files changed

+427
-245
lines changed

Some content is hidden

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

41 files changed

+427
-245
lines changed

.bazelrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ build --tool_java_runtime_version=remotejdk_17
3030
build --javacopt="--release 11"
3131

3232
# Require java dependencies to be used and first-order
33-
3433
build --experimental_strict_java_deps=strict
3534
build --explicit_java_test_deps
3635

36+
# Avoid ErrorProne getting annoyed about "impossible null checks"
37+
build --javacopt="-Xep:ImpossibleNullComparison:OFF"
38+
3739
# Allow spaces in runfile paths
3840
build --nobuild_runfile_links
3941

@@ -55,6 +57,11 @@ query --@aspect_rules_ts//ts:default_to_tsc_transpiler
5557

5658
build --incompatible_strict_action_env
5759

60+
# Required to get `protobuf` compiling, which is required for `rules_closure`
61+
build --incompatible_enable_cc_toolchain_resolution
62+
build --cxxopt=-std=c++14
63+
build --host_cxxopt=-std=c++14
64+
5865
# For build stamping
5966

6067
build --enable_platform_specific_config

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
1212
bazel_dep(name = "platforms", version = "0.0.10")
1313

1414
# Required for the closure rules
15-
bazel_dep(name = "protobuf", version = "21.7", dev_dependency = True, repo_name = "com_google_protobuf")
15+
bazel_dep(name = "protobuf", version = "29.1", dev_dependency = True, repo_name = "com_google_protobuf")
1616

1717
# Required for rules_rust to import the crates properly
1818
bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True)

WORKSPACE

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
66

77
http_archive(
88
name = "io_bazel_rules_closure",
9-
patch_args = [
10-
"-p1",
11-
],
12-
patches = [
13-
"//javascript:rules_closure_shell.patch",
14-
],
15-
sha256 = "d66deed38a0bb20581c15664f0ab62270af5940786855c7adc3087b27168b529",
16-
strip_prefix = "rules_closure-0.11.0",
17-
urls = [
18-
"https://github.com/bazelbuild/rules_closure/archive/0.11.0.tar.gz",
19-
],
9+
strip_prefix = "rules_closure-0.12.0",
10+
url = "https://github.com/bazelbuild/rules_closure/archive/refs/tags/0.12.0.tar.gz",
2011
)
2112

2213
load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")

dotnet/src/webdriver/Alert.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
using System;
2121
using System.Collections.Generic;
2222

23+
#nullable enable
24+
2325
namespace OpenQA.Selenium
2426
{
2527
/// <summary>
2628
/// Defines the interface through which the user can manipulate JavaScript alerts.
2729
/// </summary>
2830
internal class Alert : IAlert
2931
{
30-
private WebDriver driver;
32+
private readonly WebDriver driver;
3133

3234
/// <summary>
3335
/// Initializes a new instance of the <see cref="Alert"/> class.
@@ -41,12 +43,12 @@ public Alert(WebDriver driver)
4143
/// <summary>
4244
/// Gets the text of the alert.
4345
/// </summary>
44-
public string Text
46+
public string? Text
4547
{
4648
get
4749
{
4850
Response commandResponse = this.driver.InternalExecute(DriverCommand.GetAlertText, null);
49-
return commandResponse.Value.ToString();
51+
return (string?)commandResponse.Value;
5052
}
5153
}
5254

@@ -70,9 +72,10 @@ public void Accept()
7072
/// Sends keys to the alert.
7173
/// </summary>
7274
/// <param name="keysToSend">The keystrokes to send.</param>
75+
/// <exception cref="ArgumentNullException">If <paramref name="keysToSend" /> is <see langword="null"/>.</exception>
7376
public void SendKeys(string keysToSend)
7477
{
75-
if (keysToSend == null)
78+
if (keysToSend is null)
7679
{
7780
throw new ArgumentNullException(nameof(keysToSend), "Keys to send must not be null.");
7881
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public abstract record ClipRectangle
6262
{
6363
public record Box(double X, double Y, double Width, double Height) : ClipRectangle;
6464

65-
public record Element([property: JsonPropertyName("element")] Script.SharedReference SharedReference) : ClipRectangle;
65+
public record Element([property: JsonPropertyName("element")] Script.ISharedReference SharedReference) : ClipRectangle;
6666
}
6767

6868
public record CaptureScreenshotResult(string Data)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ internal record LocateNodesCommandParameters(BrowsingContext Context, Locator Lo
3333

3434
public Script.SerializationOptions? SerializationOptions { get; set; }
3535

36-
public IEnumerable<Script.SharedReference>? StartNodes { get; set; }
36+
public IEnumerable<Script.ISharedReference>? StartNodes { get; set; }
3737
}
3838

3939
public record LocateNodesOptions : CommandOptions
@@ -42,7 +42,7 @@ public record LocateNodesOptions : CommandOptions
4242

4343
public Script.SerializationOptions? SerializationOptions { get; set; }
4444

45-
public IEnumerable<Script.SharedReference>? StartNodes { get; set; }
45+
public IEnumerable<Script.ISharedReference>? StartNodes { get; set; }
4646
}
4747

4848
public record LocateNodesResult : IReadOnlyList<Script.RemoteValue.Node>

dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public record Viewport() : Origin;
2929

3030
public record Pointer() : Origin;
3131

32-
public record Element([property: JsonPropertyName("element")] Script.SharedReference SharedReference) : Origin
32+
public record Element([property: JsonPropertyName("element")] Script.ISharedReference SharedReference) : Origin
3333
{
3434
public string Type { get; } = "element";
3535
}

dotnet/src/webdriver/BiDi/Modules/Script/RemoteReference.cs renamed to dotnet/src/webdriver/BiDi/Modules/Script/IRemoteReference.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="RemoteReference.cs" company="Selenium Committers">
1+
// <copyright file="IRemoteReference.cs" company="Selenium Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -21,14 +21,18 @@
2121

2222
namespace OpenQA.Selenium.BiDi.Modules.Script;
2323

24-
public abstract record RemoteReference : LocalValue;
24+
public interface IRemoteReference;
2525

26-
public record SharedReference(string SharedId) : RemoteReference
26+
public interface ISharedReference : IRemoteReference
2727
{
28+
public string SharedId { get; }
29+
2830
public Handle? Handle { get; set; }
2931
}
3032

31-
public record RemoteObjectReference(Handle Handle) : RemoteReference
33+
public interface IRemoteObjectReference : IRemoteReference
3234
{
35+
public Handle Handle { get; }
36+
3337
public string? SharedId { get; set; }
3438
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public record HtmlCollection : RemoteValue
246246
public IReadOnlyList<RemoteValue>? Value { get; set; }
247247
}
248248

249-
public record Node : RemoteValue
249+
public record Node : RemoteValue, ISharedReference
250250
{
251251
[JsonInclude]
252252
public string? SharedId { get; internal set; }

dotnet/src/webdriver/BiDi/Modules/Session/ProxyConfiguration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
namespace OpenQA.Selenium.BiDi.Modules.Session;
2525

2626
[JsonPolymorphic(TypeDiscriminatorPropertyName = "proxyType")]
27-
[JsonDerivedType(typeof(Autodetect), "autodetect")]
27+
[JsonDerivedType(typeof(AutoDetect), "autodetect")]
2828
[JsonDerivedType(typeof(Direct), "direct")]
2929
[JsonDerivedType(typeof(Manual), "manual")]
3030
[JsonDerivedType(typeof(Pac), "pac")]
3131
[JsonDerivedType(typeof(System), "system")]
3232
public abstract record ProxyConfiguration
3333
{
34-
public record Autodetect : ProxyConfiguration;
34+
public record AutoDetect : ProxyConfiguration;
3535

3636
public record Direct : ProxyConfiguration;
3737

@@ -48,7 +48,7 @@ public record Manual : ProxyConfiguration
4848
public long? SocksVersion { get; set; }
4949
}
5050

51-
public record Pac(string ProxyAutoconfigUrl) : ProxyConfiguration;
51+
public record Pac(string ProxyAutoConfigUrl) : ProxyConfiguration;
5252

5353
public record System : ProxyConfiguration;
5454
}

0 commit comments

Comments
 (0)