Skip to content

Commit 1a6e524

Browse files
Merge branch 'trunk' into unhandled-error
2 parents cea0ced + c2d859c commit 1a6e524

33 files changed

+352
-83
lines changed

.skipped-tests

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest
66
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest-edge
77
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest-remote
8-
-//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest
98
-//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest
109
-//java/test/org/openqa/selenium/grid/gridui:OverallGridTest
1110
-//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"accounts_endpoint": "accounts.json",
33
"client_metadata_endpoint": "client_metadata.json",
4-
"id_assertion_endpoint": "id_assertion",
5-
"signin_url": "/signin",
6-
"login_url": "/login"
4+
"id_assertion_endpoint": "id_assertion.json",
5+
"signin_url": "signin",
6+
"login_url": "login"
77
}

common/src/web/fedcm/fedcm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<script>
33

4-
let configURL = `http://${location.host}/fedcm/fedcm.json`;
4+
let configURL = `http://${location.host}/fedcm/config.json`;
55
let promise = null;
66

77
function triggerFedCm() {
@@ -17,4 +17,4 @@
1717
return promise;
1818
}
1919

20-
</script>
20+
</script>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 = `https://${location.host}/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+
document.getElementById('result').innerText = JSON.stringify(result);
29+
} catch (error) {
30+
console.error("FedCM Error:", error);
31+
result = { error: error.message };
32+
document.getElementById('result').innerText = JSON.stringify(result);
33+
}
34+
}
35+
</script>
36+
</body>
37+
</html>

common/src/web/fedcm/login.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Login</title>
5+
</head>
6+
<body>
7+
<h1>Login Page</h1>
8+
<p>Login successful! This is a placeholder for the login process.</p>
9+
<a href="/">Return to Home</a>
10+
</body>
11+
</html>

common/src/web/fedcm/signin.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Sign In</title>
5+
</head>
6+
<body>
7+
<h1>Sign In Page</h1>
8+
<p>This is a placeholder for the sign-in page.</p>
9+
<form action="/signin" method="post">
10+
<label for="username">Username:</label>
11+
<input type="text" id="username" name="username" required>
12+
<br><br>
13+
<label for="password">Password:</label>
14+
<input type="password" id="password" name="password" required>
15+
<br><br>
16+
<button type="submit">Sign In</button>
17+
</form>
18+
</body>
19+
</html>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public interface FederatedCredentialManagementDialog {
5252
/** Returns the subtitle of the dialog or null if none. */
5353
String getSubtitle();
5454

55+
void clickDialog();
56+
5557
/**
5658
* Returns the accounts shown in the account chooser.
5759
*

java/src/org/openqa/selenium/grid/commands/Hub.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ protected Handlers createHandlers(Config config) {
144144
distributorOptions.getSlotMatcher(),
145145
newSessionRequestOptions.getSessionRequestTimeoutPeriod(),
146146
newSessionRequestOptions.getSessionRequestTimeout(),
147+
newSessionRequestOptions.getMaximumResponseDelay(),
147148
secret,
148149
newSessionRequestOptions.getBatchSize());
149150
handler.addHandler(queue);

java/src/org/openqa/selenium/grid/commands/Standalone.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ protected Handlers createHandlers(Config config) {
150150
distributorOptions.getSlotMatcher(),
151151
newSessionRequestOptions.getSessionRequestTimeoutPeriod(),
152152
newSessionRequestOptions.getSessionRequestTimeout(),
153+
newSessionRequestOptions.getMaximumResponseDelay(),
153154
registrationSecret,
154155
newSessionRequestOptions.getBatchSize());
155156
combinedHandler.addHandler(queue);

java/src/org/openqa/selenium/grid/distributor/local/LocalDistributor.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import org.openqa.selenium.grid.data.NodeHeartBeatEvent;
7878
import org.openqa.selenium.grid.data.NodeId;
7979
import org.openqa.selenium.grid.data.NodeRemovedEvent;
80+
import org.openqa.selenium.grid.data.NodeRestartedEvent;
8081
import org.openqa.selenium.grid.data.NodeStatus;
8182
import org.openqa.selenium.grid.data.NodeStatusEvent;
8283
import org.openqa.selenium.grid.data.RequestId;
@@ -205,6 +206,7 @@ public LocalDistributor(
205206

206207
bus.addListener(NodeStatusEvent.listener(this::register));
207208
bus.addListener(NodeStatusEvent.listener(model::refresh));
209+
bus.addListener(NodeRestartedEvent.listener(this::handleNodeRestarted));
208210
bus.addListener(NodeRemovedEvent.listener(nodeStatus -> remove(nodeStatus.getNodeId())));
209211
bus.addListener(
210212
NodeHeartBeatEvent.listener(
@@ -327,6 +329,25 @@ private void register(NodeStatus status) {
327329
}
328330
}
329331

332+
private void handleNodeRestarted(NodeStatus status) {
333+
Require.nonNull("Node", status);
334+
Lock writeLock = lock.writeLock();
335+
writeLock.lock();
336+
try {
337+
if (!nodes.containsKey(status.getNodeId())) {
338+
return;
339+
}
340+
if (!getNodeFromURI(status.getExternalUri()).isDraining()) {
341+
LOG.info(
342+
String.format(
343+
"Node %s has restarted. Setting availability to DOWN.", status.getNodeId()));
344+
model.setAvailability(status.getNodeId(), DOWN);
345+
}
346+
} finally {
347+
writeLock.unlock();
348+
}
349+
}
350+
330351
@Override
331352
public LocalDistributor add(Node node) {
332353
Require.nonNull("Node", node);

0 commit comments

Comments
 (0)