Skip to content

Commit

Permalink
[java] Code formatting no functional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 4, 2021
1 parent 1007a72 commit d7253f3
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions java/client/src/org/openqa/selenium/devtools/DevTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,26 @@ public void createSession() {
// Grab the first "page" type, and glom on to that.
// TODO: Find out which one might be the current one
TargetID targetId = infos.stream()
.filter(info -> "page".equals(info.getType()))
.map(TargetInfo::getTargetId)
.findAny()
.orElseThrow(() -> new DevToolsException("Unable to find target id of a page"));
.filter(info -> "page".equals(info.getType()))
.map(TargetInfo::getTargetId)
.findAny()
.orElseThrow(() -> new DevToolsException("Unable to find target id of a page"));

// Start the session.
cdpSession =
connection
.sendAndWait(cdpSession, getDomains().target().attachToTarget(targetId), timeout);
cdpSession = connection
.sendAndWait(cdpSession, getDomains().target().attachToTarget(targetId), timeout);

try {
// We can do all of these in parallel, and we don't care about the result.
CompletableFuture.allOf(
// Set auto-attach to true and run for the hills.
connection.send(cdpSession, getDomains().target().setAutoAttach()),
// Clear the existing logs
connection.send(cdpSession, getDomains().log().clear())
.exceptionally(t -> {
t.printStackTrace();
return null;
})
// Set auto-attach to true and run for the hills.
connection.send(cdpSession, getDomains().target().setAutoAttach()),
// Clear the existing logs
connection.send(cdpSession, getDomains().log().clear())
.exceptionally(t -> {
t.printStackTrace();
return null;
})
).get(timeout.toMillis(), MILLISECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Expand Down

0 comments on commit d7253f3

Please sign in to comment.