Skip to content

Commit 31553ec

Browse files
committed
[java] update Java formatting
1 parent 15e01dc commit 31553ec

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

java/src/org/openqa/selenium/bidi/browsingcontext/BrowsingContext.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,22 @@ public String captureScreenshot() {
228228

229229
public String captureBoxScreenshot(double x, double y, double width, double height) {
230230
return this.bidi.send(
231-
new Command<>(
232-
"browsingContext.captureScreenshot",
233-
ImmutableMap.of(CONTEXT, id,
234-
"clip", ImmutableMap.of(
235-
"type", "viewport",
236-
"x", x,
237-
"y", y,
238-
"width", width,
239-
"height", height
240-
)),
241-
jsonInput -> {
242-
Map<String, Object> result = jsonInput.read(Map.class);
243-
return (String) result.get("data");
244-
}));
231+
new Command<>(
232+
"browsingContext.captureScreenshot",
233+
ImmutableMap.of(
234+
CONTEXT,
235+
id,
236+
"clip",
237+
ImmutableMap.of(
238+
"type", "viewport",
239+
"x", x,
240+
"y", y,
241+
"width", width,
242+
"height", height)),
243+
jsonInput -> {
244+
Map<String, Object> result = jsonInput.read(Map.class);
245+
return (String) result.get("data");
246+
}));
245247
}
246248

247249
public void close() {

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
2121
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
22-
import static org.junit.jupiter.api.Assertions.fail;
2322
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
2423
import static org.openqa.selenium.testing.Safely.safelyCall;
2524
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
@@ -29,7 +28,6 @@
2928
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;
3029

3130
import java.util.List;
32-
3331
import org.junit.jupiter.api.AfterEach;
3432
import org.junit.jupiter.api.BeforeEach;
3533
import org.junit.jupiter.api.Test;
@@ -78,7 +76,7 @@ void canCreateAWindow() {
7876
@NotYetImplemented(EDGE)
7977
void canCreateAWindowWithAReferenceContext() {
8078
BrowsingContext browsingContext =
81-
new BrowsingContext(driver, WindowType.WINDOW, driver.getWindowHandle());
79+
new BrowsingContext(driver, WindowType.WINDOW, driver.getWindowHandle());
8280
assertThat(browsingContext.getId()).isNotEmpty();
8381
}
8482

@@ -97,7 +95,7 @@ void canCreateATab() {
9795
@NotYetImplemented(EDGE)
9896
void canCreateATabWithAReferenceContext() {
9997
BrowsingContext browsingContext =
100-
new BrowsingContext(driver, WindowType.TAB, driver.getWindowHandle());
98+
new BrowsingContext(driver, WindowType.TAB, driver.getWindowHandle());
10199
assertThat(browsingContext.getId()).isNotEmpty();
102100
}
103101

@@ -362,8 +360,8 @@ void canCaptureScreenshot() {
362360
@NotYetImplemented(CHROME)
363361
void canCaptureScreenshotOfViewport() {
364362
String expectedBase64EncodedImage =
365-
"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVQYV2P8z8AARIQB41BQOAvomScE/MIElGdcCFS4B"
366-
+ "8hYTEAx3NdLgApjkRRbA9mrgRgUdrdBJsKC5x6Qo4yksBbIbkLiwxW+BwoKIUnUAdmNSHwAe44dOkRcP14AAAAASUVORK5CYII=";
363+
"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVQYV2P8z8AARIQB41BQOAvomScE/MIElGdcCFS4B"
364+
+ "8hYTEAx3NdLgApjkRRbA9mrgRgUdrdBJsKC5x6Qo4yksBbIbkLiwxW+BwoKIUnUAdmNSHwAe44dOkRcP14AAAAASUVORK5CYII=";
367365

368366
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
369367

@@ -372,11 +370,9 @@ void canCaptureScreenshotOfViewport() {
372370

373371
Rectangle elementRectangle = element.getRect();
374372

375-
String screenshot = browsingContext.captureBoxScreenshot(
376-
elementRectangle.getX(),
377-
elementRectangle.getY(),
378-
5,
379-
5);
373+
String screenshot =
374+
browsingContext.captureBoxScreenshot(
375+
elementRectangle.getX(), elementRectangle.getY(), 5, 5);
380376

381377
assertThat(screenshot.length()).isPositive();
382378
assertThat(screenshot).isEqualTo(expectedBase64EncodedImage);

0 commit comments

Comments
 (0)