Skip to content

Commit 88165c8

Browse files
authored
Merge branch 'trunk' into feature/ft-16215-non-empty-driver-path
2 parents d58a545 + a578a47 commit 88165c8

35 files changed

+6278
-7812
lines changed

WORKSPACE

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ rules_closure_toolchains()
2626

2727
http_archive(
2828
name = "rules_rust",
29-
integrity = "sha256-eEXiHXSGUH6qD1bdI5KXZ/B04m0wIUeoyM7pmujzbbQ=",
30-
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.55.5/rules_rust-0.55.5.tar.gz"],
29+
integrity = "sha256-YrnH/f8jCpEqGAU+keNqauc+QSde9egtcFXqPtJuee4=",
30+
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.65.0/rules_rust-0.65.0.tar.gz"],
3131
)
3232

3333
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
@@ -48,3 +48,7 @@ crates_repository(
4848
load("@crates//:defs.bzl", "crate_repositories")
4949

5050
crate_repositories()
51+
52+
load("@rules_rust//cargo:deps.bzl", "cargo_dependencies")
53+
54+
cargo_dependencies()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// <copyright file="IBaseNavigationInfo.cs" company="Selenium Committers">
2+
// Licensed to the Software Freedom Conservancy (SFC) under one
3+
// or more contributor license agreements. See the NOTICE file
4+
// distributed with this work for additional information
5+
// regarding copyright ownership. The SFC licenses this file
6+
// to you under the Apache License, Version 2.0 (the
7+
// "License"); you may not use this file except in compliance
8+
// with the License. You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing,
13+
// software distributed under the License is distributed on an
14+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
// KIND, either express or implied. See the License for the
16+
// specific language governing permissions and limitations
17+
// under the License.
18+
// </copyright>
19+
20+
using System;
21+
22+
namespace OpenQA.Selenium.BiDi.BrowsingContext;
23+
24+
public interface IBaseNavigationInfo
25+
{
26+
BrowsingContext Context { get; }
27+
28+
Navigation? Navigation { get; }
29+
30+
DateTimeOffset Timestamp { get; }
31+
32+
string Url { get; }
33+
}

dotnet/src/webdriver/BiDi/BrowsingContext/NavigationInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
namespace OpenQA.Selenium.BiDi.BrowsingContext;
2323

2424
public sealed record NavigationInfo(BiDi BiDi, BrowsingContext Context, Navigation? Navigation, DateTimeOffset Timestamp, string Url)
25-
: BrowsingContextEventArgs(BiDi, Context);
25+
: BrowsingContextEventArgs(BiDi, Context), IBaseNavigationInfo;

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,33 @@ public async Task ConnectAsync(CancellationToken cancellationToken)
123123

124124
private async Task ReceiveMessagesAsync(CancellationToken cancellationToken)
125125
{
126-
while (!cancellationToken.IsCancellationRequested)
126+
try
127127
{
128-
try
128+
while (!cancellationToken.IsCancellationRequested)
129129
{
130130
var data = await _transport.ReceiveAsync(cancellationToken).ConfigureAwait(false);
131131

132-
ProcessReceivedMessage(data);
133-
}
134-
catch (Exception ex)
135-
{
136-
if (cancellationToken.IsCancellationRequested is not true && _logger.IsEnabled(LogEventLevel.Error))
132+
try
137133
{
138-
_logger.Error($"Couldn't process received BiDi remote message: {ex}");
134+
ProcessReceivedMessage(data);
139135
}
136+
catch (Exception ex)
137+
{
138+
if (_logger.IsEnabled(LogEventLevel.Error))
139+
{
140+
_logger.Error($"Unhandled error occured while processing remote message: {ex}");
141+
}
142+
}
143+
}
144+
}
145+
catch (Exception ex) when (ex is not OperationCanceledException)
146+
{
147+
if (_logger.IsEnabled(LogEventLevel.Error))
148+
{
149+
_logger.Error($"Unhandled error occured while receiving remote messages: {ex}");
140150
}
151+
152+
throw;
141153
}
142154
}
143155

dotnet/src/webdriver/DriverService.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,9 @@ public void Start()
268268

269269
this.driverServiceProcess.Start();
270270

271-
if (this.EnableProcessRedirection)
272-
{
273-
// Important: Start the process and immediately begin reading the output and error streams to avoid IO deadlocks.
274-
this.driverServiceProcess.BeginOutputReadLine();
275-
this.driverServiceProcess.BeginErrorReadLine();
276-
}
271+
// Important: Start the process and immediately begin reading the output and error streams to avoid IO deadlocks.
272+
this.driverServiceProcess.BeginOutputReadLine();
273+
this.driverServiceProcess.BeginErrorReadLine();
277274

278275
bool serviceAvailable = this.WaitForServiceInitialization();
279276

py/selenium/webdriver/chrome/service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def __init__(
5454
**kwargs,
5555
)
5656

57+
def command_line_args(self) -> list[str]:
58+
return ["--enable-chrome-logs", f"--port={self.port}"] + self._service_args
59+
5760
@property
5861
def service_args(self) -> Sequence[str]:
5962
return self._service_args

rb/Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PATH
66
selenium-webdriver (4.36.0.nightly)
77
base64 (~> 0.2)
88
logger (~> 1.4)
9+
prism (~> 1.0, < 1.5)
910
rexml (~> 3.2, >= 3.2.5)
1011
rubyzip (>= 1.2.2, < 4.0)
1112
websocket (~> 1.0)

rb/selenium-webdriver.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Gem::Specification.new do |s|
5151

5252
s.add_dependency 'base64', ['~> 0.2']
5353
s.add_dependency 'logger', ['~> 1.4']
54+
s.add_dependency 'prism', ['~> 1.0', '< 1.5']
5455
s.add_dependency 'rexml', ['~> 3.2', '>= 3.2.5']
5556
s.add_dependency 'rubyzip', ['>= 1.2.2', '< 4.0']
5657
s.add_dependency 'websocket', ['~> 1.0']

rust/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ rust_binary(
7676
# instead of an underscore
7777
name = "selenium-manager",
7878
srcs = ["src/main.rs"],
79-
edition = "2021",
79+
edition = "2024",
8080
version = "0.4.36-nightly",
8181
visibility = ["//visibility:public"],
8282
deps = [
@@ -91,7 +91,7 @@ rust_library(
9191
["src/**/*.rs"],
9292
exclude = ["main.rs"],
9393
),
94-
edition = "2021",
94+
edition = "2024",
9595
visibility = ["//rust:__subpackages__"],
9696
deps = all_crate_deps(normal = True),
9797
)
@@ -115,6 +115,6 @@ rust_test(
115115
name = "unit",
116116
size = "small",
117117
crate = ":selenium_manager",
118-
edition = "2021",
118+
edition = "2024",
119119
tags = ["no-sandbox"],
120120
)

0 commit comments

Comments
 (0)