Skip to content

Commit

Permalink
Run format script. No logical changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Sep 22, 2023
1 parent 1337b20 commit 9e20c44
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,27 @@ public List<BrowsingContextInfo> getTopLevelContexts() {
}

public NavigationResult reload() {
return this.bidi.send(new Command<>(RELOAD, ImmutableMap.of(CONTEXT, id), navigationInfoMapper));
return this.bidi.send(
new Command<>(RELOAD, ImmutableMap.of(CONTEXT, id), navigationInfoMapper));
}

// Yet to be implemented by browser vendors
private NavigationResult reload(boolean ignoreCache) {
return this.bidi.send(new Command<>(
RELOAD,
ImmutableMap.of(CONTEXT, id, "ignoreCache", ignoreCache),
navigationInfoMapper));
return this.bidi.send(
new Command<>(
RELOAD,
ImmutableMap.of(CONTEXT, id, "ignoreCache", ignoreCache),
navigationInfoMapper));
}

// TODO: Handle timeouts in case of Readiness state "interactive" and "complete".
// Refer https://github.com/w3c/webdriver-bidi/issues/188
public NavigationResult reload(ReadinessState readinessState) {
return this.bidi.send(
new Command<>(
RELOAD,
ImmutableMap.of(CONTEXT, id, "wait", readinessState.toString()),
navigationInfoMapper));
RELOAD,
ImmutableMap.of(CONTEXT, id, "wait", readinessState.toString()),
navigationInfoMapper));
}

// Yet to be implemented by browser vendors
Expand All @@ -198,7 +200,7 @@ public void handleUserPrompt() {

public void handleUserPrompt(boolean accept) {
this.bidi.send(
new Command<>(HANDLE_USER_PROMPT, ImmutableMap.of(CONTEXT, id, "accept", accept)));
new Command<>(HANDLE_USER_PROMPT, ImmutableMap.of(CONTEXT, id, "accept", accept)));
}

public void handleUserPrompt(String userText) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,26 @@ void canCaptureScreenshot() {

private String alertPage() {
return appServer.create(
new Page()
.withTitle("Testing Alerts")
.withBody(
"<a href='#' id='alert' onclick='alert(\"works\");'>click me</a>"));
new Page()
.withTitle("Testing Alerts")
.withBody("<a href='#' id='alert' onclick='alert(\"works\");'>click me</a>"));
}

private String promptPage() {
return appServer.create(
new Page()
.withTitle("Testing Alerts")
.withScripts(
"function myFunction() {",
" let message = prompt('Please enter a message');",
" if (message != null) {",
" document.getElementById('result').innerHTML =",
" 'Message: ' + message ;",
" }",
"}")
.withBody("<button id='alert' onclick='myFunction()'>Try it</button>",
"<p id=\"result\"></p>"));
new Page()
.withTitle("Testing Alerts")
.withScripts(
"function myFunction() {",
" let message = prompt('Please enter a message');",
" if (message != null) {",
" document.getElementById('result').innerHTML =",
" 'Message: ' + message ;",
" }",
"}")
.withBody(
"<button id='alert' onclick='myFunction()'>Try it</button>",
"<p id=\"result\"></p>"));
}

@AfterEach
Expand Down

0 comments on commit 9e20c44

Please sign in to comment.