Skip to content

Commit 41a60e6

Browse files
committed
browsingContextInfo.getChildren() can return an empty list
One reading of the bidi spec says that this value should be an empty list, but a reasonable interpretation is that it could also be `null`. Handle both cases in the java tests.
1 parent e69d5c5 commit 41a60e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/test/org/openqa/selenium/bidi/browsingcontext/BrowsingContextInspectorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
2121

22+
import java.util.List;
2223
import java.util.concurrent.CompletableFuture;
2324
import java.util.concurrent.ExecutionException;
2425
import java.util.concurrent.TimeUnit;
@@ -70,7 +71,7 @@ void canListenToBrowsingContextDestroyedEvent()
7071

7172
assertThat(browsingContextInfo.getId()).isEqualTo(windowHandle);
7273
assertThat("about:blank").isEqualTo(browsingContextInfo.getUrl());
73-
assertThat(browsingContextInfo.getChildren()).isEqualTo(null);
74+
assertThat(browsingContextInfo.getChildren()).isIn(null, List.of());
7475
assertThat(browsingContextInfo.getParentBrowsingContext()).isEqualTo(null);
7576
}
7677
}

0 commit comments

Comments
 (0)