Skip to content

Commit e5659be

Browse files
authored
Merge branch 'trunk' into drop-py3.8
2 parents 5ad5136 + 81f435d commit e5659be

File tree

21 files changed

+609
-139
lines changed

21 files changed

+609
-139
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ maven.install(
181181
"com.graphql-java:graphql-java:22.3",
182182
"dev.failsafe:failsafe:3.3.2",
183183
"io.grpc:grpc-context:1.69.0",
184-
"io.lettuce:lettuce-core:6.5.1.RELEASE",
184+
"io.lettuce:lettuce-core:6.5.2.RELEASE",
185185
"io.netty:netty-buffer",
186186
"io.netty:netty-codec-http",
187187
"io.netty:netty-codec-http2",
@@ -201,10 +201,10 @@ maven.install(
201201
"io.opentelemetry.semconv:opentelemetry-semconv:1.28.0-alpha",
202202
"it.ozimov:embedded-redis:0.7.3",
203203
"net.bytebuddy:byte-buddy:1.15.11",
204-
"org.htmlunit:htmlunit-core-js:4.6.0",
204+
"org.htmlunit:htmlunit-core-js:4.7.0",
205205
"org.apache.commons:commons-exec:1.4.0",
206206
"org.apache.logging.log4j:log4j-core:2.24.3",
207-
"org.assertj:assertj-core:3.27.1",
207+
"org.assertj:assertj-core:3.27.2",
208208
"org.bouncycastle:bcpkix-jdk18on:1.79",
209209
"org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5",
210210
"org.hsqldb:hsqldb:2.7.4",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>FedCM Example</title>
5+
</head>
6+
<body>
7+
<button id="triggerButton" onclick="triggerFedCm()">Trigger FedCM</button>
8+
<div id="result"></div>
9+
10+
<script>
11+
// Use a relative path for the configURL
12+
let configURL = `http://${location.host}/common/fedcm/config.json`;
13+
console.log(configURL)
14+
let result = null;
15+
16+
async function triggerFedCm() {
17+
console.log("Config URL:", configURL);
18+
try {
19+
let promise = await navigator.credentials.get({
20+
identity: {
21+
providers: [{
22+
configURL: configURL,
23+
clientId: '1',
24+
}]
25+
}
26+
});
27+
result = promise;
28+
29+
console.log("Promised!")
30+
console.log(result)
31+
document.getElementById('result').innerText = JSON.stringify(result);
32+
} catch (error) {
33+
console.error("FedCM Error:", error);
34+
result = { error: error.message };
35+
document.getElementById('result').innerText = JSON.stringify(result);
36+
}
37+
}
38+
</script>
39+
</body>
40+
</html>

dotnet/src/webdriver/Remote/HttpCommandExecutor.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ private async Task<HttpResponseInfo> MakeHttpRequest(HttpRequestInfo requestInfo
316316

317317
private Response CreateResponse(HttpResponseInfo responseInfo)
318318
{
319-
Response response = new Response();
319+
Response response;
320320
string body = responseInfo.Body;
321321
if ((int)responseInfo.StatusCode < 200 || (int)responseInfo.StatusCode > 299)
322322
{
@@ -326,8 +326,7 @@ private Response CreateResponse(HttpResponseInfo responseInfo)
326326
}
327327
else
328328
{
329-
response.Status = WebDriverResult.UnknownError;
330-
response.Value = body;
329+
response = new Response(sessionId: null, body, WebDriverResult.UnknownError);
331330
}
332331
}
333332
else if (responseInfo.ContentType != null && responseInfo.ContentType.StartsWith(JsonMimeType, StringComparison.OrdinalIgnoreCase))
@@ -336,12 +335,12 @@ private Response CreateResponse(HttpResponseInfo responseInfo)
336335
}
337336
else
338337
{
339-
response.Value = body;
338+
response = new Response(sessionId: null, body, WebDriverResult.Success);
340339
}
341340

342-
if (response.Value is string)
341+
if (response.Value is string valueString)
343342
{
344-
response.Value = ((string)response.Value).Replace("\r\n", "\n").Replace("\n", Environment.NewLine);
343+
response.Value = valueString.Replace("\r\n", "\n").Replace("\n", Environment.NewLine);
345344
}
346345

347346
return response;

dotnet/src/webdriver/Response.cs

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
using System.Text.Json;
2525
using System.Text.Json.Serialization;
2626

27+
#nullable enable
28+
2729
namespace OpenQA.Selenium
2830
{
2931
/// <summary>
@@ -48,88 +50,98 @@ public Response()
4850
/// Initializes a new instance of the <see cref="Response"/> class
4951
/// </summary>
5052
/// <param name="sessionId">Session ID in use</param>
51-
public Response(SessionId sessionId)
53+
public Response(SessionId? sessionId)
5254
{
53-
if (sessionId != null)
54-
{
55-
this.SessionId = sessionId.ToString();
56-
}
55+
this.SessionId = sessionId?.ToString();
56+
}
57+
58+
/// <summary>
59+
/// Initializes a new instance of the <see cref="Response"/> class
60+
/// </summary>
61+
/// <param name="sessionId">The Session ID in use, if any.</param>
62+
/// <param name="value">The JSON payload of the response.</param>
63+
/// <param name="status">The WebDriver result status of the response.</param>
64+
public Response(string? sessionId, object? value, WebDriverResult status)
65+
{
66+
this.SessionId = sessionId;
67+
this.Value = value;
68+
this.Status = status;
5769
}
5870

5971
/// <summary>
6072
/// Returns a new <see cref="Response"/> from a JSON-encoded string.
6173
/// </summary>
6274
/// <param name="value">The JSON string to deserialize into a <see cref="Response"/>.</param>
6375
/// <returns>A <see cref="Response"/> object described by the JSON string.</returns>
76+
/// <exception cref="ArgumentNullException">If <paramref name="value"/> is <see langword="null"/>.</exception>
77+
/// <exception cref="JsonException">If <paramref name="value"/> is not a valid JSON object.</exception>
6478
public static Response FromJson(string value)
6579
{
66-
Dictionary<string, object> rawResponse = JsonSerializer.Deserialize<Dictionary<string, object>>(value, s_jsonSerializerOptions)
80+
Dictionary<string, object?> rawResponse = JsonSerializer.Deserialize<Dictionary<string, object?>>(value, s_jsonSerializerOptions)
6781
?? throw new WebDriverException("JSON success response returned \"null\" value");
6882

69-
var response = new Response();
83+
object? contents;
84+
string? sessionId = null;
7085

71-
if (rawResponse.ContainsKey("sessionId"))
86+
if (rawResponse.TryGetValue("sessionId", out object? s) && s is not null)
7287
{
73-
if (rawResponse["sessionId"] != null)
74-
{
75-
response.SessionId = rawResponse["sessionId"].ToString();
76-
}
88+
sessionId = s.ToString();
7789
}
7890

79-
if (rawResponse.TryGetValue("value", out object valueObj))
91+
if (rawResponse.TryGetValue("value", out object? valueObj))
8092
{
81-
response.Value = valueObj;
93+
contents = valueObj;
8294
}
83-
84-
// If the returned object does *not* have a "value" property
85-
// the response value should be the entirety of the response.
86-
// TODO: Remove this if statement altogether; there should
87-
// never be a spec-compliant response that does not contain a
88-
// value property.
89-
if (!rawResponse.ContainsKey("value") && response.Value == null)
95+
else
9096
{
97+
// If the returned object does *not* have a "value" property
98+
// the response value should be the entirety of the response.
99+
// TODO: Remove this if statement altogether; there should
100+
// never be a spec-compliant response that does not contain a
101+
// value property.
102+
91103
// Special-case for the new session command, where the "capabilities"
92104
// property of the response is the actual value we're interested in.
93-
if (rawResponse.ContainsKey("capabilities"))
105+
if (rawResponse.TryGetValue("capabilities", out object? capabilities))
94106
{
95-
response.Value = rawResponse["capabilities"];
107+
contents = capabilities;
96108
}
97109
else
98110
{
99-
response.Value = rawResponse;
111+
contents = rawResponse;
100112
}
101113
}
102114

103-
if (response.Value is Dictionary<string, object> valueDictionary)
115+
if (contents is Dictionary<string, object?> valueDictionary)
104116
{
105117
// Special case code for the new session command. If the response contains
106118
// sessionId and capabilities properties, fix up the session ID and value members.
107-
if (valueDictionary.ContainsKey("sessionId"))
119+
if (valueDictionary.TryGetValue("sessionId", out object? session))
108120
{
109-
response.SessionId = valueDictionary["sessionId"].ToString();
110-
if (valueDictionary.TryGetValue("capabilities", out object capabilities))
121+
sessionId = session.ToString();
122+
if (valueDictionary.TryGetValue("capabilities", out object? capabilities))
111123
{
112-
response.Value = capabilities;
124+
contents = capabilities;
113125
}
114126
else
115127
{
116-
response.Value = valueDictionary["value"];
128+
contents = valueDictionary["value"];
117129
}
118130
}
119131
}
120132

121-
return response;
133+
return new Response(sessionId, contents, WebDriverResult.Success);
122134
}
123135

124136
/// <summary>
125137
/// Gets or sets the value from JSON.
126138
/// </summary>
127-
public object Value { get; set; }
139+
public object? Value { get; set; }
128140

129141
/// <summary>
130142
/// Gets or sets the session ID.
131143
/// </summary>
132-
public string SessionId { get; set; }
144+
public string? SessionId { get; set; }
133145

134146
/// <summary>
135147
/// Gets or sets the status value of the response.
@@ -142,26 +154,25 @@ public static Response FromJson(string value)
142154
/// </summary>
143155
/// <param name="value">The JSON string to deserialize into a <see cref="Response"/>.</param>
144156
/// <returns>A <see cref="Response"/> object described by the JSON string.</returns>
157+
/// <exception cref="ArgumentNullException">If <paramref name="value"/> is <see langword="null"/>.</exception>
158+
/// <exception cref="JsonException">If <paramref name="value"/> is not a valid JSON object.</exception>
159+
/// <exception cref="WebDriverException">If the JSON dictionary is not in the expected state, per spec.</exception>
145160
public static Response FromErrorJson(string value)
146161
{
147-
var deserializedResponse = JsonSerializer.Deserialize<Dictionary<string, object>>(value, s_jsonSerializerOptions)
162+
Dictionary<string, object?> deserializedResponse = JsonSerializer.Deserialize<Dictionary<string, object?>>(value, s_jsonSerializerOptions)
148163
?? throw new WebDriverException("JSON error response returned \"null\" value");
149164

150-
var response = new Response();
151-
152-
if (!deserializedResponse.TryGetValue("value", out var valueObject))
165+
if (!deserializedResponse.TryGetValue("value", out object? valueObject))
153166
{
154167
throw new WebDriverException($"The 'value' property was not found in the response:{Environment.NewLine}{value}");
155168
}
156169

157-
if (valueObject is not Dictionary<string, object> valueDictionary)
170+
if (valueObject is not Dictionary<string, object?> valueDictionary)
158171
{
159172
throw new WebDriverException($"The 'value' property is not a dictionary of <string, object>{Environment.NewLine}{value}");
160173
}
161174

162-
response.Value = valueDictionary;
163-
164-
if (!valueDictionary.TryGetValue("error", out var errorObject))
175+
if (!valueDictionary.TryGetValue("error", out object? errorObject))
165176
{
166177
throw new WebDriverException($"The 'value > error' property was not found in the response:{Environment.NewLine}{value}");
167178
}
@@ -171,11 +182,9 @@ public static Response FromErrorJson(string value)
171182
throw new WebDriverException($"The 'value > error' property is not a string{Environment.NewLine}{value}");
172183
}
173184

174-
response.Value = deserializedResponse["value"];
175-
176-
response.Status = WebDriverError.ResultFromError(errorString);
185+
WebDriverResult status = WebDriverError.ResultFromError(errorString);
177186

178-
return response;
187+
return new Response(sessionId: null, valueDictionary, status);
179188
}
180189

181190
/// <summary>

java/maven_install.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
3-
"__INPUT_ARTIFACTS_HASH": -1069673593,
4-
"__RESOLVED_ARTIFACTS_HASH": -1004221368,
3+
"__INPUT_ARTIFACTS_HASH": 1132645732,
4+
"__RESOLVED_ARTIFACTS_HASH": 1947623231,
55
"artifacts": {
66
"com.beust:jcommander": {
77
"shasums": {
@@ -228,10 +228,10 @@
228228
},
229229
"io.lettuce:lettuce-core": {
230230
"shasums": {
231-
"jar": "ff26c28351becdaf6d5abe25d97ea799a986b1746bfe5f70659d1e53745b6f1a",
232-
"sources": "383337d6e56a97563c31f2d06838c85f8295662a5f7f72408bef5d59329cf98a"
231+
"jar": "59f6a591a631d844b355b831ee723bf6ce98d92f7a775de6b0690f0eb81480e7",
232+
"sources": "e9d835ed5b0583fbf01deabdb2c4ab370ac73166a4011aac5f1e2ca397914912"
233233
},
234-
"version": "6.5.1.RELEASE"
234+
"version": "6.5.2.RELEASE"
235235
},
236236
"io.netty:netty-buffer": {
237237
"shasums": {
@@ -550,10 +550,10 @@
550550
},
551551
"org.assertj:assertj-core": {
552552
"shasums": {
553-
"jar": "ab4ab885146bc5dfbdd4cdfb06f1ae72ec6b5e8139f0ccdabcbe51374aebac0d",
554-
"sources": "0c9a7b4a85f3609bf700ad13f4173cde85cadcdd8feb829e059a000a5b9aa932"
553+
"jar": "a8079b4cb67dca1dc5c7650bf27bd59277834c63280b661475986de3b602e3ae",
554+
"sources": "fc96972d63cc234226a10b5a434acb085033f2bc68035df92abc3331595aa73d"
555555
},
556-
"version": "3.27.1"
556+
"version": "3.27.2"
557557
},
558558
"org.bouncycastle:bcpkix-jdk18on": {
559559
"shasums": {
@@ -606,10 +606,10 @@
606606
},
607607
"org.htmlunit:htmlunit-core-js": {
608608
"shasums": {
609-
"jar": "709c43eaab5b407468239b49ba990a7170ee582cbaa6a11c09a6118da22fdedc",
610-
"sources": "458acacd14d851ad0ad20310787b35d3224d0c31155bd6b17d41de2b352bb1b7"
609+
"jar": "4f0c609fbfd2ca2ca9163cc63e9b947b13a57b5644400e2b1902c1335d160888",
610+
"sources": "5834536abb3402f859cbb31f48d113e36c2dc6bc7dd7e01eca6478a61d00c70c"
611611
},
612-
"version": "4.6.0"
612+
"version": "4.7.0"
613613
},
614614
"org.jodd:jodd-util": {
615615
"shasums": {

java/src/org/openqa/selenium/Platform.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
public enum Platform {
3333

3434
/** Never returned, but can be used to request a browser running on any version of Windows. */
35-
WINDOWS("") {
35+
WINDOWS("windows") {
3636
@Override
3737
public Platform family() {
3838
return null;
@@ -302,6 +302,18 @@ public String toString() {
302302
}
303303
},
304304

305+
SEQUOIA("sequoia", "os x 15.0", "macos 15.0") {
306+
@Override
307+
public Platform family() {
308+
return MAC;
309+
}
310+
311+
@Override
312+
public String toString() {
313+
return "macOS 15.0";
314+
}
315+
},
316+
305317
/** Many platforms have UNIX traits, amongst them LINUX, Solaris and BSD. */
306318
UNIX("solaris", "bsd") {
307319
@Override

0 commit comments

Comments
 (0)