Skip to content

Commit ca28435

Browse files
authored
Merge branch 'trunk' into window-switcher
2 parents 6ee0001 + 9a4bbcc commit ca28435

File tree

11 files changed

+99
-118
lines changed

11 files changed

+99
-118
lines changed

common/repositories.bzl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def pin_browsers():
1111

1212
http_archive(
1313
name = "linux_firefox",
14-
url = "https://ftp.mozilla.org/pub/firefox/releases/143.0/linux-x86_64/en-US/firefox-143.0.tar.xz",
15-
sha256 = "1c87a9de21941a15177384d4820a6aa3c7dacb38d34089c73a621734ebf1ea9a",
14+
url = "https://ftp.mozilla.org/pub/firefox/releases/143.0.1/linux-x86_64/en-US/firefox-143.0.1.tar.xz",
15+
sha256 = "0d515c65248d4485cc8f5abf4e3b09a9a65363f2b4e6b8435309a4c87e500720",
1616
build_file_content = """
1717
load("@aspect_rules_js//js:defs.bzl", "js_library")
1818
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,8 @@ js_library(
3333

3434
dmg_archive(
3535
name = "mac_firefox",
36-
url = "https://ftp.mozilla.org/pub/firefox/releases/143.0/mac/en-US/Firefox%20143.0.dmg",
37-
sha256 = "a5c570e277021b61df1295efe77446617ebd768d8ad36a20b309aa382685f6f2",
36+
url = "https://ftp.mozilla.org/pub/firefox/releases/143.0.1/mac/en-US/Firefox%20143.0.1.dmg",
37+
sha256 = "c37afd2e0ec1ea5e6d508779ffefdf2c404752392288a6a7f0f1670fe8747e3c",
3838
build_file_content = """
3939
load("@aspect_rules_js//js:defs.bzl", "js_library")
4040
package(default_visibility = ["//visibility:public"])
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/144.0b2/linux-x86_64/en-US/firefox-144.0b2.tar.xz",
54-
sha256 = "f290da89a61c6d339968c2994a947843daf205510c979e2f636d5f29f310113a",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/144.0b3/linux-x86_64/en-US/firefox-144.0b3.tar.xz",
54+
sha256 = "9a0a43727f04cce4300c9867e6a84d1b45757d813d5d9de9964ea1ce3f4ebb64",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/144.0b2/mac/en-US/Firefox%20144.0b2.dmg",
76-
sha256 = "5b7dadba49cd0087d540bc86cceba5da39d182aff174c526d5ac33d1b6c70b7b",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/144.0b3/mac/en-US/Firefox%20144.0b3.dmg",
76+
sha256 = "2a4cec948bead6832c21c81ea0dcba8bcf7c47ee24ba7aabd4f6abd1fad97752",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/548659d9-fd7c-41ae-98f2-88c5d8e2900e/MicrosoftEdge-140.0.3485.66.pkg",
127-
sha256 = "18d0dae9bcc13d02ea46934c45109a3b76075eadb5a1c25191ec44b3583aee32",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/58ef038e-b996-434e-9c2f-d8f71502826d/MicrosoftEdge-140.0.3485.81.pkg",
127+
sha256 = "b11cb1210e1732932741d06694044e6cee43b1b5f3599d30d9c62d449ce6ff73",
128128
move = {
129-
"MicrosoftEdge-140.0.3485.66.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-140.0.3485.81.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_140.0.3485.66-1_amd64.deb",
147-
sha256 = "fc84c914286741ae572b89d07b76e21b0eafbd5fa92db6d935bf7cf5779c5066",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_140.0.3485.81-1_amd64.deb",
147+
sha256 = "f065fbd1129747285a3d585f8366c1d090cb926a5cc2f64352d9722aeb014cdf",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.microsoft.com/140.0.3485.66/edgedriver_linux64.zip",
169-
sha256 = "140a592ad275329d22424cd213a8a05a348a66c6bee1eec8e890c3dbe9d23742",
168+
url = "https://msedgedriver.microsoft.com/140.0.3485.81/edgedriver_linux64.zip",
169+
sha256 = "6b10c828769672720b90879f7980817d491eb475eaf28dde3739e47cbe9a6537",
170170
build_file_content = """
171171
load("@aspect_rules_js//js:defs.bzl", "js_library")
172172
package(default_visibility = ["//visibility:public"])
@@ -182,8 +182,8 @@ js_library(
182182

183183
http_archive(
184184
name = "mac_edgedriver",
185-
url = "https://msedgedriver.microsoft.com/140.0.3485.66/edgedriver_mac64.zip",
186-
sha256 = "69456486f9559620c0fcfc118f9ccfa232d7d4f7886347cf164e39b2a9205a03",
185+
url = "https://msedgedriver.microsoft.com/140.0.3485.81/edgedriver_mac64.zip",
186+
sha256 = "aed876db66a8c5c74ab59fe2405f88e0a378e08bf12c447079cebd07f035c771",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])

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

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -276,27 +276,7 @@ public async Task UnsubscribeAsync(Session.Subscription subscription, EventHandl
276276

277277
eventHandlers.Remove(eventHandler);
278278

279-
if (subscription is not null)
280-
{
281-
await _bidi.SessionModule.UnsubscribeAsync([subscription]).ConfigureAwait(false);
282-
}
283-
else
284-
{
285-
if (eventHandler.Contexts is not null)
286-
{
287-
if (!eventHandlers.Any(h => eventHandler.Contexts.Equals(h.Contexts)) && !eventHandlers.Any(h => h.Contexts is null))
288-
{
289-
await _bidi.SessionModule.UnsubscribeAsync([eventHandler.EventName], new() { Contexts = eventHandler.Contexts }).ConfigureAwait(false);
290-
}
291-
}
292-
else
293-
{
294-
if (!eventHandlers.Any(h => h.Contexts is not null) && !eventHandlers.Any(h => h.Contexts is null))
295-
{
296-
await _bidi.SessionModule.UnsubscribeAsync([eventHandler.EventName]).ConfigureAwait(false);
297-
}
298-
}
299-
}
279+
await _bidi.SessionModule.UnsubscribeAsync([subscription]).ConfigureAwait(false);
300280
}
301281

302282
public async ValueTask DisposeAsync()

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ namespace OpenQA.Selenium.BiDi.Communication.Json;
7878
[JsonSerializable(typeof(Session.SubscribeCommand))]
7979
[JsonSerializable(typeof(Session.SubscribeResult))]
8080
[JsonSerializable(typeof(Session.UnsubscribeByIdCommand))]
81-
[JsonSerializable(typeof(Session.UnsubscribeByAttributesCommand))]
8281

8382
[JsonSerializable(typeof(Browser.CloseCommand), TypeInfoPropertyName = "Browser_CloseCommand")]
8483
[JsonSerializable(typeof(Browser.CreateUserContextCommand))]

dotnet/src/webdriver/BiDi/Session/SessionModule.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ public async Task<EmptyResult> UnsubscribeAsync(IEnumerable<Subscription> subscr
4444
return await Broker.ExecuteCommandAsync<UnsubscribeByIdCommand, EmptyResult>(new UnsubscribeByIdCommand(@params), options).ConfigureAwait(false);
4545
}
4646

47-
public async Task<EmptyResult> UnsubscribeAsync(IEnumerable<string> eventNames, UnsubscribeByAttributesOptions? options = null)
48-
{
49-
var @params = new UnsubscribeByAttributesParameters(eventNames, options?.Contexts);
50-
51-
return await Broker.ExecuteCommandAsync<UnsubscribeByAttributesCommand, EmptyResult>(new UnsubscribeByAttributesCommand(@params), options).ConfigureAwait(false);
52-
}
53-
5447
public async Task<NewResult> NewAsync(CapabilitiesRequest capabilitiesRequest, NewOptions? options = null)
5548
{
5649
var @params = new NewParameters(capabilitiesRequest);

dotnet/src/webdriver/BiDi/Session/UnsubscribeCommand.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,13 @@
1818
// </copyright>
1919

2020
using OpenQA.Selenium.BiDi.Communication;
21-
using System;
2221
using System.Collections.Generic;
2322

2423
namespace OpenQA.Selenium.BiDi.Session;
2524

2625
internal sealed class UnsubscribeByIdCommand(UnsubscribeByIdParameters @params)
2726
: Command<UnsubscribeByIdParameters, EmptyResult>(@params, "session.unsubscribe");
2827

29-
internal sealed class UnsubscribeByAttributesCommand(UnsubscribeByAttributesParameters @params)
30-
: Command<UnsubscribeByAttributesParameters, EmptyResult>(@params, "session.unsubscribe");
31-
3228
internal sealed record UnsubscribeByIdParameters(IEnumerable<Subscription> Subscriptions) : Parameters;
3329

3430
public sealed class UnsubscribeByIdOptions : CommandOptions;
35-
36-
internal sealed record UnsubscribeByAttributesParameters(
37-
IEnumerable<string> Events,
38-
[property: Obsolete("Contexts param is deprecated and will be removed in the future versions")]
39-
// https://w3c.github.io/webdriver-bidi/#type-session-UnsubscribeByAttributesRequest
40-
IEnumerable<BrowsingContext.BrowsingContext>? Contexts) : Parameters;
41-
42-
public sealed class UnsubscribeByAttributesOptions : CommandOptions
43-
{
44-
public IEnumerable<BrowsingContext.BrowsingContext>? Contexts { get; set; }
45-
}

dotnet/src/webdriver/DriverService.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ public int ProcessId
170170
/// </summary>
171171
protected virtual bool HasShutdown => true;
172172

173+
/// <summary>
174+
/// Gets a value indicating whether process redirection is enforced regardless of other settings.
175+
/// </summary>
176+
/// <remarks>Set this property to <see langword="true"/> to force all process output and error streams to
177+
/// be redirected, even if redirection is not required by default behavior. This can be useful in scenarios where
178+
/// capturing process output is necessary for logging or analysis.</remarks>
179+
protected virtual internal bool EnableProcessRedirection { get; } = false;
180+
173181
/// <summary>
174182
/// Gets a value indicating whether the service is responding to HTTP requests.
175183
/// </summary>
@@ -249,14 +257,18 @@ public void Start()
249257
this.driverServiceProcess.StartInfo.RedirectStandardOutput = true;
250258
this.driverServiceProcess.StartInfo.RedirectStandardError = true;
251259

252-
this.driverServiceProcess.OutputDataReceived += this.OnDriverProcessDataReceived;
253-
this.driverServiceProcess.ErrorDataReceived += this.OnDriverProcessDataReceived;
260+
if (this.EnableProcessRedirection)
261+
{
262+
this.driverServiceProcess.OutputDataReceived += this.OnDriverProcessDataReceived;
263+
this.driverServiceProcess.ErrorDataReceived += this.OnDriverProcessDataReceived;
264+
}
254265

255266
DriverProcessStartingEventArgs eventArgs = new DriverProcessStartingEventArgs(this.driverServiceProcess.StartInfo);
256267
this.OnDriverProcessStarting(eventArgs);
257268

258-
// Important: Start the process and immediately begin reading the output and error streams to avoid IO deadlocks.
259269
this.driverServiceProcess.Start();
270+
271+
// Important: Start the process and immediately begin reading the output and error streams to avoid IO deadlocks.
260272
this.driverServiceProcess.BeginOutputReadLine();
261273
this.driverServiceProcess.BeginErrorReadLine();
262274

@@ -289,7 +301,7 @@ protected virtual void Dispose(bool disposing)
289301
{
290302
this.Stop();
291303

292-
if (this.driverServiceProcess is not null)
304+
if (EnableProcessRedirection && this.driverServiceProcess is not null)
293305
{
294306
this.driverServiceProcess.OutputDataReceived -= this.OnDriverProcessDataReceived;
295307
this.driverServiceProcess.ErrorDataReceived -= this.OnDriverProcessDataReceived;
@@ -335,13 +347,7 @@ protected virtual void OnDriverProcessStarted(DriverProcessStartedEventArgs even
335347
/// <param name="args">The data received event arguments.</param>
336348
protected virtual void OnDriverProcessDataReceived(object sender, DataReceivedEventArgs args)
337349
{
338-
if (string.IsNullOrEmpty(args.Data))
339-
return;
340350

341-
if (_logger.IsEnabled(LogEventLevel.Trace))
342-
{
343-
_logger.Trace(args.Data);
344-
}
345351
}
346352

347353
/// <summary>

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ protected override string CommandLineArguments
222222
}
223223
}
224224

225+
/// <summary>
226+
/// Gets a value indicating whether process output redirection is required.
227+
/// </summary>
228+
protected internal override bool EnableProcessRedirection => LogPath is not null;
229+
225230
/// <summary>
226231
/// Called when the driver process is starting. This method sets up log file writing if a log path is specified.
227232
/// </summary>

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)