Skip to content

Commit 3a6dd59

Browse files
authored
Merge branch 'trunk' into feature/add-macos-keys
2 parents 1b45035 + 47af349 commit 3a6dd59

File tree

5 files changed

+117
-5
lines changed

5 files changed

+117
-5
lines changed

common/repositories.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ js_library(
165165

166166
http_archive(
167167
name = "linux_edgedriver",
168-
url = "https://msedgedriver.azureedge.net/137.0.3296.83/edgedriver_linux64.zip",
169-
sha256 = "141cd4cd42b7642dec1f215e0b1a0c1dae05f573218cb8ef18b876efa14f152a",
168+
url = "https://msedgedriver.azureedge.net/137.0.3296.93/edgedriver_linux64.zip",
169+
sha256 = "417bdfafbe8358e2b040b86b0e255344e0d200bd7087a9d85171abc9fc0c29c3",
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/137.0.3296.83/edgedriver_mac64.zip",
186-
sha256 = "e361cfea041e649944a60a41ec40076be35fda8608e9011fad638ec0491a1f79",
185+
url = "https://msedgedriver.azureedge.net/137.0.3296.93/edgedriver_mac64.zip",
186+
sha256 = "d55e0f377ba45c1d754625b88f16493bded924b41bd624210241493b77e4fdb9",
187187
build_file_content = """
188188
load("@aspect_rules_js//js:defs.bzl", "js_library")
189189
package(default_visibility = ["//visibility:public"])
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Licensed to the Software Freedom Conservancy (SFC) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The SFC licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.openqa.selenium.bidi.browsingcontext;
19+
20+
import static java.util.Collections.unmodifiableMap;
21+
22+
import java.util.Map;
23+
import java.util.TreeMap;
24+
import org.openqa.selenium.json.JsonInput;
25+
26+
public class HistoryUpdated {
27+
28+
private final String browsingContextId;
29+
30+
private final int timestamp;
31+
32+
private final String url;
33+
34+
private HistoryUpdated(String browsingContextId, int timestamp, String url) {
35+
this.browsingContextId = browsingContextId;
36+
this.timestamp = timestamp;
37+
this.url = url;
38+
}
39+
40+
public static HistoryUpdated fromJson(JsonInput input) {
41+
String browsingContextId = null;
42+
int timestamp = 0;
43+
String url = null;
44+
45+
input.beginObject();
46+
while (input.hasNext()) {
47+
switch (input.nextName()) {
48+
case "context":
49+
browsingContextId = input.read(String.class);
50+
break;
51+
52+
case "timestamp":
53+
timestamp = input.read(int.class);
54+
break;
55+
56+
case "url":
57+
url = input.read(String.class);
58+
break;
59+
60+
default:
61+
input.skipValue();
62+
break;
63+
}
64+
}
65+
66+
input.endObject();
67+
68+
return new HistoryUpdated(browsingContextId, timestamp, url);
69+
}
70+
71+
public String getBrowsingContextId() {
72+
return browsingContextId;
73+
}
74+
75+
public int getTimestamp() {
76+
return timestamp;
77+
}
78+
79+
public String getUrl() {
80+
return url;
81+
}
82+
83+
private Map<String, Object> toJson() {
84+
Map<String, Object> toReturn = new TreeMap<>();
85+
86+
toReturn.put("browsingContextId", this.getBrowsingContextId());
87+
toReturn.put("timestamp", this.getTimestamp());
88+
toReturn.put("url", this.getUrl());
89+
90+
return unmodifiableMap(toReturn);
91+
}
92+
}

java/src/org/openqa/selenium/bidi/module/BrowsingContextInspector.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.openqa.selenium.bidi.Event;
3030
import org.openqa.selenium.bidi.HasBiDi;
3131
import org.openqa.selenium.bidi.browsingcontext.BrowsingContextInfo;
32+
import org.openqa.selenium.bidi.browsingcontext.HistoryUpdated;
3233
import org.openqa.selenium.bidi.browsingcontext.NavigationInfo;
3334
import org.openqa.selenium.bidi.browsingcontext.UserPromptClosed;
3435
import org.openqa.selenium.bidi.browsingcontext.UserPromptOpened;
@@ -88,6 +89,16 @@ public class BrowsingContextInspector implements AutoCloseable {
8889
}
8990
});
9091

92+
private final Event<HistoryUpdated> historyUpdated =
93+
new Event<>(
94+
"browsingContext.historyUpdated",
95+
params -> {
96+
try (StringReader reader = new StringReader(JSON.toJson(params));
97+
JsonInput input = JSON.newInput(reader)) {
98+
return input.read(HistoryUpdated.class);
99+
}
100+
});
101+
91102
public BrowsingContextInspector(WebDriver driver) {
92103
this(new HashSet<>(), driver);
93104
}
@@ -172,6 +183,14 @@ public void onUserPromptOpened(Consumer<UserPromptOpened> consumer) {
172183
}
173184
}
174185

186+
public void onHistoryUpdated(Consumer<HistoryUpdated> consumer) {
187+
if (browsingContextIds.isEmpty()) {
188+
this.bidi.addListener(historyUpdated, consumer);
189+
} else {
190+
this.bidi.addListener(browsingContextIds, historyUpdated, consumer);
191+
}
192+
}
193+
175194
private void addNavigationEventListener(String name, Consumer<NavigationInfo> consumer) {
176195
Event<NavigationInfo> navigationEvent = new Event<>(name, navigationInfoMapper);
177196

@@ -190,6 +209,7 @@ public void close() {
190209
this.bidi.clearListener(browsingContextDestroyed);
191210
this.bidi.clearListener(userPromptOpened);
192211
this.bidi.clearListener(userPromptClosed);
212+
this.bidi.clearListener(historyUpdated);
193213

194214
navigationEventSet.forEach(this.bidi::clearListener);
195215
}

java/src/org/openqa/selenium/remote/CommandPayload.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class CommandPayload {
2525
private final Map<String, ?> parameters;
2626

2727
public CommandPayload(String name, Map<String, ?> parameters) {
28-
2928
this.name = name;
3029
this.parameters = parameters;
3130
}

rb/lib/selenium/webdriver/common/proxy.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def ==(other)
7777
alias eql? ==
7878

7979
def ftp=(value)
80+
WebDriver.logger.deprecate('FTP proxy support', nil, id: :ftp_proxy)
8081
self.type = :manual
8182
@ftp = value
8283
end

0 commit comments

Comments
 (0)