Skip to content

Commit 5c5c68e

Browse files
committed
[bidi][java] Update argument type to RemoteValue
1 parent 907b4f4 commit 5c5c68e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

java/src/org/openqa/selenium/bidi/log/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ java_library(
1616
deps = [
1717
"//java/src/org/openqa/selenium:core",
1818
"//java/src/org/openqa/selenium/bidi",
19+
"//java/src/org/openqa/selenium/bidi/script",
1920
"//java/src/org/openqa/selenium/json",
2021
"//java/src/org/openqa/selenium/remote/http",
2122
],

java/src/org/openqa/selenium/bidi/log/ConsoleLogEntry.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.List;
2323
import java.util.Map;
2424
import java.util.TreeMap;
25+
import org.openqa.selenium.bidi.script.RemoteValue;
2526
import org.openqa.selenium.json.JsonInput;
2627
import org.openqa.selenium.json.TypeToken;
2728

@@ -31,7 +32,7 @@ public class ConsoleLogEntry extends GenericLogEntry {
3132

3233
private final String method;
3334
private final String realm;
34-
private final List<Object> args;
35+
private final List<RemoteValue> args;
3536

3637
public ConsoleLogEntry(
3738
LogLevel level,
@@ -40,7 +41,7 @@ public ConsoleLogEntry(
4041
String type,
4142
String method,
4243
String realm,
43-
List<Object> args,
44+
List<RemoteValue> args,
4445
StackTrace stackTrace) {
4546
super(level, text, timestamp, type, stackTrace);
4647
this.method = method;
@@ -56,7 +57,7 @@ public String getRealm() {
5657
return realm;
5758
}
5859

59-
public List<Object> getArgs() {
60+
public List<RemoteValue> getArgs() {
6061
return args;
6162
}
6263

@@ -67,7 +68,7 @@ public static ConsoleLogEntry fromJson(JsonInput input) {
6768
String type = null;
6869
String method = null;
6970
String realm = null;
70-
List<Object> args = null;
71+
List<RemoteValue> args = null;
7172
StackTrace stackTrace = null;
7273

7374
input.beginObject();
@@ -98,7 +99,7 @@ public static ConsoleLogEntry fromJson(JsonInput input) {
9899
break;
99100

100101
case "args":
101-
args = input.read(new TypeToken<List<Object>>() {}.getType());
102+
args = input.read(new TypeToken<List<RemoteValue>>() {}.getType());
102103
break;
103104

104105
case "stackTrace":

java/test/org/openqa/selenium/bidi/log/LogInspectorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void canListenToConsoleLog() throws ExecutionException, InterruptedException, Ti
6666
assertThat(logEntry.getText()).isEqualTo("Hello, world!");
6767
assertThat(logEntry.getRealm()).isNull();
6868
assertThat(logEntry.getArgs().size()).isEqualTo(1);
69+
assertThat(logEntry.getArgs().get(0).getType()).isEqualTo("string");
6970
assertThat(logEntry.getType()).isEqualTo("console");
7071
assertThat(logEntry.getLevel()).isEqualTo(LogLevel.INFO);
7172
assertThat(logEntry.getMethod()).isEqualTo("log");

0 commit comments

Comments
 (0)