Skip to content

Commit ba4237c

Browse files
authored
Merge branch 'trunk' into jspecify-interactions
2 parents 91a55a5 + da46ab0 commit ba4237c

File tree

23 files changed

+657
-188
lines changed

23 files changed

+657
-188
lines changed

java/src/org/openqa/selenium/federatedcredentialmanagement/FederatedCredentialManagementAccount.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
package org.openqa.selenium.federatedcredentialmanagement;
1919

2020
import java.util.Map;
21+
import org.jspecify.annotations.NullMarked;
22+
import org.jspecify.annotations.Nullable;
2123

2224
/**
2325
* Represents an account displayed in a FedCM account list.
@@ -27,29 +29,30 @@
2729
* @see <a href="https://w3c-fedid.github.io/FedCM/#webdriver-accountlist">
2830
* https://w3c-fedid.github.io/FedCM/#webdriver-accountlist</a>
2931
*/
32+
@NullMarked
3033
public class FederatedCredentialManagementAccount {
31-
private final String accountId;
32-
private final String email;
33-
private final String name;
34-
private final String givenName;
35-
private final String pictureUrl;
34+
private final @Nullable String accountId;
35+
private final @Nullable String email;
36+
private final @Nullable String name;
37+
private final @Nullable String givenName;
38+
private final @Nullable String pictureUrl;
3639

3740
/**
3841
* The config URL of the identity provider that provided this account.
3942
*
4043
* <p>This allows identifying the IDP in multi-IDP cases.
4144
*/
42-
private final String idpConfigUrl;
45+
private final @Nullable String idpConfigUrl;
4346

4447
/**
4548
* The login state for this account.
4649
*
4750
* <p>One of LOGIN_STATE_SIGNIN and LOGIN_STATE_SIGNUP.
4851
*/
49-
private final String loginState;
52+
private final @Nullable String loginState;
5053

51-
private final String termsOfServiceUrl;
52-
private final String privacyPolicyUrl;
54+
private final @Nullable String termsOfServiceUrl;
55+
private final @Nullable String privacyPolicyUrl;
5356

5457
public static final String LOGIN_STATE_SIGNIN = "SignIn";
5558
public static final String LOGIN_STATE_SIGNUP = "SignUp";
@@ -66,39 +69,39 @@ public FederatedCredentialManagementAccount(Map<String, String> dict) {
6669
privacyPolicyUrl = (String) dict.getOrDefault("privacyPolicyUrl", null);
6770
}
6871

69-
public String getAccountid() {
72+
public @Nullable String getAccountid() {
7073
return accountId;
7174
}
7275

73-
public String getEmail() {
76+
public @Nullable String getEmail() {
7477
return email;
7578
}
7679

77-
public String getName() {
80+
public @Nullable String getName() {
7881
return name;
7982
}
8083

81-
public String getGivenName() {
84+
public @Nullable String getGivenName() {
8285
return givenName;
8386
}
8487

85-
public String getPictureUrl() {
88+
public @Nullable String getPictureUrl() {
8689
return pictureUrl;
8790
}
8891

89-
public String getIdpConfigUrl() {
92+
public @Nullable String getIdpConfigUrl() {
9093
return idpConfigUrl;
9194
}
9295

93-
public String getLoginState() {
96+
public @Nullable String getLoginState() {
9497
return loginState;
9598
}
9699

97-
public String getTermsOfServiceUrl() {
100+
public @Nullable String getTermsOfServiceUrl() {
98101
return termsOfServiceUrl;
99102
}
100103

101-
public String getPrivacyPolicyUrl() {
104+
public @Nullable String getPrivacyPolicyUrl() {
102105
return privacyPolicyUrl;
103106
}
104107
}

java/src/org/openqa/selenium/federatedcredentialmanagement/FederatedCredentialManagementDialog.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
package org.openqa.selenium.federatedcredentialmanagement;
1919

2020
import java.util.List;
21+
import org.jspecify.annotations.NullMarked;
22+
import org.jspecify.annotations.Nullable;
2123

2224
/**
2325
* Represents an open dialog of the Federated Credential Management API.
2426
*
2527
* @see <a href="https://w3c-fedid.github.io/FedCM/">https://w3c-fedid.github.io/FedCM/</a>
2628
*/
29+
@NullMarked
2730
public interface FederatedCredentialManagementDialog {
2831

2932
String DIALOG_TYPE_ACCOUNT_LIST = "AccountChooser";
@@ -44,13 +47,13 @@ public interface FederatedCredentialManagementDialog {
4447
*
4548
* <p>One of DIALOG_TYPE_ACCOUNT_LIST and DIALOG_TYPE_AUTO_REAUTH.
4649
*/
47-
String getDialogType();
50+
@Nullable String getDialogType();
4851

4952
/** Returns the title of the dialog. */
50-
String getTitle();
53+
@Nullable String getTitle();
5154

5255
/** Returns the subtitle of the dialog or null if none. */
53-
String getSubtitle();
56+
@Nullable String getSubtitle();
5457

5558
void clickDialog();
5659

java/src/org/openqa/selenium/federatedcredentialmanagement/HasFederatedCredentialManagement.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717

1818
package org.openqa.selenium.federatedcredentialmanagement;
1919

20+
import org.jspecify.annotations.NullMarked;
21+
import org.jspecify.annotations.Nullable;
2022
import org.openqa.selenium.Beta;
2123

2224
/** Used by classes to indicate that they can interact with FedCM dialogs. */
2325
@Beta
26+
@NullMarked
2427
public interface HasFederatedCredentialManagement {
2528
/**
2629
* Disables the promise rejection delay.
@@ -45,5 +48,5 @@ public interface HasFederatedCredentialManagement {
4548
* <p>Can be used with WebDriverWait like: wait.until(driver ->
4649
* ((HasFederatedCredentialManagement) driver). getFederatedCredentialManagementDialog() != null);
4750
*/
48-
FederatedCredentialManagementDialog getFederatedCredentialManagementDialog();
51+
@Nullable FederatedCredentialManagementDialog getFederatedCredentialManagementDialog();
4952
}

py/selenium/webdriver/common/bidi/cdp.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ class CdpConnectionClosed(WsConnectionClosed):
166166
def __init__(self, reason):
167167
"""Constructor.
168168
169-
:param reason:
170-
:type reason: wsproto.frame_protocol.CloseReason
169+
Args:
170+
reason: wsproto.frame_protocol.CloseReason
171171
"""
172172
self.reason = reason
173173

@@ -205,8 +205,11 @@ def __init__(self, ws, session_id, target_id):
205205
async def execute(self, cmd: Generator[dict, T, Any]) -> T:
206206
"""Execute a command on the server and wait for the result.
207207
208-
:param cmd: any CDP command
209-
:returns: a CDP result
208+
Args:
209+
cmd: any CDP command
210+
211+
Returns:
212+
a CDP result
210213
"""
211214
cmd_id = next(self.id_iter)
212215
cmd_event = trio.Event()
@@ -261,18 +264,20 @@ async def wait_for(self, event_type: type[T], buffer_size=10) -> AsyncGenerator[
261264
def _handle_data(self, data):
262265
"""Handle incoming WebSocket data.
263266
264-
:param dict data: a JSON dictionary
267+
Args:
268+
data: a JSON dictionary
265269
"""
266270
if "id" in data:
267271
self._handle_cmd_response(data)
268272
else:
269273
self._handle_event(data)
270274

271-
def _handle_cmd_response(self, data):
275+
def _handle_cmd_response(self, data: dict):
272276
"""Handle a response to a command. This will set an event flag that
273277
will return control to the task that called the command.
274278
275-
:param dict data: response as a JSON dictionary
279+
Args:
280+
data: response as a JSON dictionary
276281
"""
277282
cmd_id = data["id"]
278283
try:
@@ -295,10 +300,11 @@ def _handle_cmd_response(self, data):
295300
self.inflight_result[cmd_id] = return_
296301
event.set()
297302

298-
def _handle_event(self, data):
303+
def _handle_event(self, data: dict):
299304
"""Handle an event.
300305
301-
:param dict data: event as a JSON dictionary
306+
Args:
307+
data: event as a JSON dictionary
302308
"""
303309
global devtools
304310
event = devtools.util.parse_json_event(data)
@@ -325,9 +331,10 @@ class CdpSession(CdpBase):
325331
def __init__(self, ws, session_id, target_id):
326332
"""Constructor.
327333
328-
:param trio_websocket.WebSocketConnection ws:
329-
:param devtools.target.SessionID session_id:
330-
:param devtools.target.TargetID target_id:
334+
Args:
335+
ws: trio_websocket.WebSocketConnection
336+
session_id: devtools.target.SessionID
337+
target_id: devtools.target.TargetID
331338
"""
332339
super().__init__(ws, session_id, target_id)
333340

@@ -394,7 +401,8 @@ class corresponds to the "root" session, i.e. the implicitly created
394401
def __init__(self, ws):
395402
"""Constructor.
396403
397-
:param trio_websocket.WebSocketConnection ws:
404+
Args:
405+
ws: trio_websocket.WebSocketConnection
398406
"""
399407
super().__init__(ws, session_id=None, target_id=None)
400408
self.sessions = {}

0 commit comments

Comments
 (0)