Skip to content

Commit 81d4720

Browse files
authored
Merge branch 'trunk' into py-bidi-chrome-webextensions
2 parents 3c8f861 + ce8faa7 commit 81d4720

File tree

16 files changed

+94
-951
lines changed

16 files changed

+94
-951
lines changed

.github/workflows/bazel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
node-version: ${{ inputs.node-version }}
123123
- name: Setup Bazel with caching
124124
if: inputs.caching
125-
uses: bazel-contrib/setup-bazel@0.13.0
125+
uses: bazel-contrib/setup-bazel@0.15.0
126126
with:
127127
bazelisk-cache: true
128128
bazelrc: common --color=yes
@@ -136,7 +136,7 @@ jobs:
136136
repository-cache: true
137137
- name: Setup Bazel without caching
138138
if: inputs.caching == false
139-
uses: bazel-contrib/setup-bazel@0.13.0
139+
uses: bazel-contrib/setup-bazel@0.15.0
140140
with:
141141
bazelrc: common --color=yes
142142
- name: Setup curl for Ubuntu

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
fetch-depth: 50
2727
- name: Setup Bazel
28-
uses: bazel-contrib/setup-bazel@0.13.0
28+
uses: bazel-contrib/setup-bazel@0.15.0
2929
with:
3030
bazelisk-cache: true
3131
cache-version: 2

common/repositories.bzl

Lines changed: 25 additions & 25 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/138.0.4/linux-x86_64/en-US/firefox-138.0.4.tar.xz",
15-
sha256 = "c27d5bf7483eda49aae544d9f8b4f064dbc7341b27d7098378108e52071bf947",
14+
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0/linux-x86_64/en-US/firefox-139.0.tar.xz",
15+
sha256 = "1e3eab20cb84af1510b22e663438bd31ee1473652e10eb48661dcc6f1c0bbbe8",
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/138.0.4/mac/en-US/Firefox%20138.0.4.dmg",
37-
sha256 = "6842663f38b8b12b08b67239f0cc2118e93fa0b5b57e856c21f384fb501fb430",
36+
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0/mac/en-US/Firefox%20139.0.dmg",
37+
sha256 = "03f1066b70b6e502c4f1a732a63f9f93146c6ea23d0af5e2e3a57d030e255353",
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/139.0b10/linux-x86_64/en-US/firefox-139.0b10.tar.xz",
54-
sha256 = "c369df6474ffdece0eff47e8750d52ed7663bf1ecee88d9a19f70b3e2b206cf8",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b1/linux-x86_64/en-US/firefox-140.0b1.tar.xz",
54+
sha256 = "816e57b7a46883b9fad4be62161a070dbd57ce23e01403207d941384b644c80d",
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/139.0b10/mac/en-US/Firefox%20139.0b10.dmg",
76-
sha256 = "48bc5bf417013e457a6f3437271cbeee6bd67a0a8381bbd7deb198dc9caa3057",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b1/mac/en-US/Firefox%20140.0b1.dmg",
76+
sha256 = "1233059971a4fa9ee221872c05ba85ebd3fa4707a08a13e5771c387729eccbc0",
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/8b523c53-9ba6-4310-b0d3-9391eaf174f7/MicrosoftEdge-136.0.3240.76.pkg",
127-
sha256 = "6843377514a8ab215423998e039dcf95ec240300ed12e19f2244fd7bf77a68f1",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/0db7b32d-8b37-45ad-b2d9-b6b6cfcf91bd/MicrosoftEdge-136.0.3240.92.pkg",
127+
sha256 = "c3407b12244a854928d5731c5c52be41905ab7f7689a50503929ed21c1fe15e2",
128128
move = {
129-
"MicrosoftEdge-136.0.3240.76.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-136.0.3240.92.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_136.0.3240.76-1_amd64.deb",
147-
sha256 = "6e234cd5ec49ff151c9a16631fb65c145f5c615aac3dabdb6edb099d1565c85a",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_136.0.3240.92-1_amd64.deb",
147+
sha256 = "04b4287e74be559c365f36beb38fa8233de24ed8c8a17d95d9ce83547951d8c3",
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.azureedge.net/136.0.3240.76/edgedriver_linux64.zip",
169-
sha256 = "dbab1e25a3dc1013a929be5626324ee3ac0575b747793da51d6b8de93f0f2ff2",
168+
url = "https://msedgedriver.azureedge.net/136.0.3240.92/edgedriver_linux64.zip",
169+
sha256 = "8abb53e9a60e5587300835f9e039f12c81ae10b1b34231982b35b99637252109",
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.azureedge.net/136.0.3240.76/edgedriver_mac64.zip",
186-
sha256 = "d1cc5424b522227f0c0950ac501e52a55e0fb44ee2ebc8af3a83fc9222363e8f",
185+
url = "https://msedgedriver.azureedge.net/136.0.3240.92/edgedriver_mac64.zip",
186+
sha256 = "6d24b3fa48acfb71963605ea93778c4486442fdedde5e57aecdfac36e9dbf552",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/linux64/chrome-linux64.zip",
203-
sha256 = "1a17f1d70a085188eb78365b90b435d83350fcec1040a9383eea80ed97963204",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/linux64/chrome-linux64.zip",
203+
sha256 = "ffedd41a261f26e2e60e5d1692e0955c292caffafd15865344d21b845554a3d4",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -221,8 +221,8 @@ js_library(
221221

222222
http_archive(
223223
name = "mac_chrome",
224-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/mac-x64/chrome-mac-x64.zip",
225-
sha256 = "65fb0ae59177d2196eb62fdeb88c455f8965af2e0e9ee6640d66765c7df75450",
224+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/mac-x64/chrome-mac-x64.zip",
225+
sha256 = "1342558af92f8d8f9cb26c4504f9d49b63c0b1d6fe06485c2e01c763a67deb44",
226226
strip_prefix = "chrome-mac-x64",
227227
patch_cmds = [
228228
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -243,8 +243,8 @@ js_library(
243243

244244
http_archive(
245245
name = "linux_chromedriver",
246-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/linux64/chromedriver-linux64.zip",
247-
sha256 = "09246c6eaa804a39b8c54467bf4d62233577f67a9df11a33d8b27dd1b30a168c",
246+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/linux64/chromedriver-linux64.zip",
247+
sha256 = "57b44a6b5193511898eb1c26b3eae8378a763a6d09e7687b801a799d58e7e90d",
248248
strip_prefix = "chromedriver-linux64",
249249
build_file_content = """
250250
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +261,8 @@ js_library(
261261

262262
http_archive(
263263
name = "mac_chromedriver",
264-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.40/mac-x64/chromedriver-mac-x64.zip",
265-
sha256 = "c3c7cd781b217694ce35b9b7e2f3c3d214982a023a0c1a21dae4af320e409928",
264+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.55/mac-x64/chromedriver-mac-x64.zip",
265+
sha256 = "8a6c76cde41275f539dae1c9287c50def6481f17737b6d871237e81c26eda635",
266266
strip_prefix = "chromedriver-mac-x64",
267267
build_file_content = """
268268
load("@aspect_rules_js//js:defs.bzl", "js_library")

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

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -378,30 +378,49 @@ private void ProcessReceivedMessage(byte[]? data)
378378
case "success":
379379
if (id is null) throw new JsonException("The remote end responded with 'success' message type, but missed required 'id' property.");
380380

381-
var successCommand = _pendingCommands[id.Value];
382-
var messageSuccess = JsonSerializer.Deserialize(ref resultReader, successCommand.ResultType, _jsonSerializerContext)!;
383-
successCommand.TaskCompletionSource.SetResult((EmptyResult)messageSuccess);
384-
_pendingCommands.TryRemove(id.Value, out _);
381+
if (_pendingCommands.TryGetValue(id.Value, out var successCommand))
382+
{
383+
var messageSuccess = JsonSerializer.Deserialize(ref resultReader, successCommand.ResultType, _jsonSerializerContext)!;
384+
successCommand.TaskCompletionSource.SetResult((EmptyResult)messageSuccess);
385+
_pendingCommands.TryRemove(id.Value, out _);
386+
}
387+
else
388+
{
389+
throw new BiDiException($"The remote end responded with 'success' message type, but no pending command with id {id} was found.");
390+
}
391+
385392
break;
386393

387394
case "event":
388395
if (method is null) throw new JsonException("The remote end responded with 'event' message type, but missed required 'method' property.");
389396

390-
var eventType = _eventTypesMap[method];
397+
if (_eventTypesMap.TryGetValue(method, out var eventType))
398+
{
399+
var eventArgs = (EventArgs)JsonSerializer.Deserialize(ref paramsReader, eventType, _jsonSerializerContext)!;
391400

392-
var eventArgs = (EventArgs)JsonSerializer.Deserialize(ref paramsReader, eventType, _jsonSerializerContext)!;
401+
var messageEvent = new MessageEvent(method, eventArgs);
402+
_pendingEvents.Add(messageEvent);
403+
}
404+
else
405+
{
406+
throw new BiDiException($"The remote end responded with 'event' message type, but no event type mapping for method '{method}' was found.");
407+
}
393408

394-
var messageEvent = new MessageEvent(method, eventArgs);
395-
_pendingEvents.Add(messageEvent);
396409
break;
397410

398411
case "error":
399412
if (id is null) throw new JsonException("The remote end responded with 'error' message type, but missed required 'id' property.");
400413

401-
var messageError = new MessageError(id.Value) { Error = error, Message = message };
402-
var errorCommand = _pendingCommands[messageError.Id];
403-
errorCommand.TaskCompletionSource.SetException(new BiDiException($"{messageError.Error}: {messageError.Message}"));
404-
_pendingCommands.TryRemove(messageError.Id, out _);
414+
if (_pendingCommands.TryGetValue(id.Value, out var errorCommand))
415+
{
416+
errorCommand.TaskCompletionSource.SetException(new BiDiException($"{error}: {message}"));
417+
_pendingCommands.TryRemove(id.Value, out _);
418+
}
419+
else
420+
{
421+
throw new BiDiException($"The remote end responded with 'error' message type, but no pending command with id {id} was found.");
422+
}
423+
405424
break;
406425
}
407426
}

dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs

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

20-
using System.Collections.Generic;
2120
using System.Threading.Tasks;
2221
using OpenQA.Selenium.BiDi.Communication;
2322

@@ -32,7 +31,9 @@ public async Task CloseAsync(CloseOptions? options = null)
3231

3332
public async Task<UserContextInfo> CreateUserContextAsync(CreateUserContextOptions? options = null)
3433
{
35-
return await Broker.ExecuteCommandAsync<CreateUserContextCommand, UserContextInfo>(new CreateUserContextCommand(), options).ConfigureAwait(false);
34+
var @params = new CreateUserContextCommandParameters(options?.AcceptInsecureCerts, options?.Proxy);
35+
36+
return await Broker.ExecuteCommandAsync<CreateUserContextCommand, UserContextInfo>(new CreateUserContextCommand(@params), options).ConfigureAwait(false);
3637
}
3738

3839
public async Task<GetUserContextsResult> GetUserContextsAsync(GetUserContextsOptions? options = null)

dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121

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

24-
internal class CreateUserContextCommand()
25-
: Command<CommandParameters, UserContextInfo>(CommandParameters.Empty, "browser.createUserContext");
24+
internal class CreateUserContextCommand(CreateUserContextCommandParameters @params)
25+
: Command<CreateUserContextCommandParameters, UserContextInfo>(@params, "browser.createUserContext");
2626

27-
public record CreateUserContextOptions : CommandOptions;
27+
internal record CreateUserContextCommandParameters(bool? AcceptInsecureCerts, Session.ProxyConfiguration? Proxy) : CommandParameters;
28+
29+
public record CreateUserContextOptions : CommandOptions
30+
{
31+
public bool? AcceptInsecureCerts { get; set; }
32+
33+
public Session.ProxyConfiguration? Proxy { get; set; }
34+
}

java/src/org/openqa/selenium/ContextAware.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

java/src/org/openqa/selenium/NoSuchContextException.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

java/src/org/openqa/selenium/bidi/browsingcontext/BrowsingContext.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,6 @@ public BrowsingContext(WebDriver driver, WindowType type) {
101101
this.id = this.create(type);
102102
}
103103

104-
/*
105-
* @deprecated
106-
* Use {@link #BrowsingContext(WebDriver, CreateParameters)} instead.
107-
*/
108-
@Deprecated
109-
public BrowsingContext(WebDriver driver, WindowType type, String referenceContextId) {
110-
Require.nonNull("WebDriver", driver);
111-
Require.nonNull("Reference browsing context id", referenceContextId);
112-
113-
Require.precondition(!referenceContextId.isEmpty(), "Reference Context id cannot be empty");
114-
115-
if (!(driver instanceof HasBiDi)) {
116-
throw new IllegalArgumentException("WebDriver instance must support BiDi protocol");
117-
}
118-
119-
this.driver = driver;
120-
this.bidi = ((HasBiDi) driver).getBiDi();
121-
this.id = this.create(new CreateContextParameters(type).referenceContext(referenceContextId));
122-
}
123-
124104
public BrowsingContext(WebDriver driver, CreateContextParameters parameters) {
125105
Require.nonNull("WebDriver", driver);
126106

0 commit comments

Comments
 (0)