Skip to content

Commit 7de5a08

Browse files
committed
Merge branch 'trunk' of github.com:aguspe/selenium into trunk
2 parents efa60a2 + 93fdf57 commit 7de5a08

File tree

6 files changed

+59
-9
lines changed

6 files changed

+59
-9
lines changed
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

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']

0 commit comments

Comments
 (0)