Skip to content

Commit aee298b

Browse files
authored
chore: rename headful -> headed (#1835)
1 parent fd2ab47 commit aee298b

10 files changed

+29
-29
lines changed

playwright/src/test/java/com/microsoft/playwright/TestBase.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ public class TestBase {
4545
static final boolean isMac = Utils.getOS() == Utils.OS.MAC;
4646
static final boolean isLinux = Utils.getOS() == Utils.OS.LINUX;
4747
static final boolean isWindows = Utils.getOS() == Utils.OS.WINDOWS;
48-
static final boolean headful;
48+
static final boolean headed;
4949
static final SameSiteAttribute defaultSameSiteCookieValue;
5050

5151
static {
52-
String headfulEnv = System.getenv("HEADFUL");
53-
headful = headfulEnv != null && !"0".equals(headfulEnv) && !"false".equals(headfulEnv);
52+
String headedEnv = System.getenv("HEADED");
53+
headed = headedEnv != null && !"0".equals(headedEnv) && !"false".equals(headedEnv);
5454
defaultSameSiteCookieValue = initSameSiteAttribute();
5555
}
5656

5757
// Fields reset before each test.
5858
Page page;
5959
BrowserContext context;
6060

61-
static boolean isHeadful() {
62-
return headful;
61+
static boolean isHeaded() {
62+
return headed;
6363
}
6464

6565
static boolean isChromium() {
@@ -81,7 +81,7 @@ static String getBrowserChannelFromEnv() {
8181
static BrowserType.LaunchOptions createLaunchOptions() {
8282
BrowserType.LaunchOptions options;
8383
options = new BrowserType.LaunchOptions();
84-
options.headless = !headful;
84+
options.headless = !headed;
8585
options.channel = getBrowserChannelFromEnv();
8686
return options;
8787
}

playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCredentials.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class TestBrowserContextCredentials extends TestBase {
2727

2828
static boolean isChromiumHeadedLike() {
2929
// --headless=new, the default in all Chromium channels, is like headless.
30-
return isChromium() && (isHeadful() || getBrowserChannelFromEnv() != null);
30+
return isChromium() && (isHeaded() || getBrowserChannelFromEnv() != null);
3131
}
3232

3333
@Test

playwright/src/test/java/com/microsoft/playwright/TestBrowserContextProxy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ void shouldAuthenticate() {
129129
context.close();
130130
}
131131

132-
static boolean isChromiumHeadful() {
133-
return isChromium() && isHeadful();
132+
static boolean isChromiumHeaded() {
133+
return isChromium() && isHeaded();
134134
}
135135

136136
@Test
137-
@DisabledIf(value="isChromiumHeadful", disabledReason="fixme")
137+
@DisabledIf(value="isChromiumHeaded", disabledReason="fixme")
138138
void shouldExcludePatterns() {
139139
server.setRoute("/target.html", exchange -> {
140140
exchange.sendResponseHeaders(200, 0);

playwright/src/test/java/com/microsoft/playwright/TestDefaultBrowserContext2.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void shouldSupportIgnoreHTTPSErrorsOption() {
128128

129129
@Test
130130
void shouldSupportExtraHTTPHeadersOption() throws ExecutionException, InterruptedException {
131-
// TODO: test.flaky(browserName === "firefox" && headful && platform === "linux", "Intermittent timeout on bots");
131+
// TODO: test.flaky(browserName === "firefox" && headed && platform === "linux", "Intermittent timeout on bots");
132132
Page page = launchPersistent(new BrowserType.LaunchPersistentContextOptions().setExtraHTTPHeaders(mapOf("foo", "bar")));
133133
Future<Server.Request> request = server.futureRequest("/empty.html");
134134
page.navigate(server.EMPTY_PAGE);

playwright/src/test/java/com/microsoft/playwright/TestDownload.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ void shouldReportAltClickDownloads() throws IOException {
341341
}
342342

343343

344-
static boolean isChromiumHeadful() {
345-
return isChromium() && isHeadful();
344+
static boolean isChromiumHeaded() {
345+
return isChromium() && isHeaded();
346346
}
347347

348348
@Test
349-
@DisabledIf(value="isChromiumHeadful", disabledReason="fixme")
349+
@DisabledIf(value="isChromiumHeaded", disabledReason="fixme")
350350
void shouldReportNewWindowDownloads() throws IOException {
351-
// TODO: - the test fails in headful Chromium as the popup page gets closed along
351+
// TODO: - the test fails in headed Chromium as the popup page gets closed along
352352
// with the session before download completed event arrives.
353353
// - WebKit doesn't close the popup page
354354
Page page = browser.newPage(new Browser.NewPageOptions().setAcceptDownloads(true));

playwright/src/test/java/com/microsoft/playwright/TestElementHandleBoundingBox.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
public class TestElementHandleBoundingBox extends TestBase {
2828

29-
static boolean isFirefoxHeadful() {
30-
return isFirefox() && isHeadful();
29+
static boolean isFirefoxHeaded() {
30+
return isFirefox() && isHeaded();
3131
}
3232

3333
@Test
34-
@DisabledIf(value="isFirefoxHeadful", disabledReason="fail")
34+
@DisabledIf(value="isFirefoxHeaded", disabledReason="fail")
3535
void shouldWork() {
3636
page.setViewportSize(500, 500);
3737
page.navigate(server.PREFIX + "/grid.html");

playwright/src/test/java/com/microsoft/playwright/TestOptionsFactories.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public static String getBrowserChannelFromEnv() {
3535
public static BrowserType.LaunchOptions createLaunchOptions() {
3636
BrowserType.LaunchOptions options;
3737
options = new BrowserType.LaunchOptions();
38-
options.headless = !getHeadful();
38+
options.headless = !getHeaded();
3939
return options;
4040
}
4141

42-
private static boolean getHeadful() {
43-
String headfulEnv = System.getenv("HEADFUL");
44-
return headfulEnv != null && !"0".equals(headfulEnv) && !"false".equals(headfulEnv);
42+
private static boolean getHeaded() {
43+
String headedEnv = System.getenv("HEADED");
44+
return headedEnv != null && !"0".equals(headedEnv) && !"false".equals(headedEnv);
4545
}
4646

4747
public static String getBrowserName() {

playwright/src/test/java/com/microsoft/playwright/TestPageScreenshot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import static org.junit.jupiter.api.Assertions.*;
4141
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
4242

43-
// TODO: suite.skip(browserName === "firefox" && headful");
43+
// TODO: suite.skip(browserName === "firefox" && headed");
4444
public class TestPageScreenshot extends TestBase {
4545
@Test
4646
void shouldWork() throws IOException {

playwright/src/test/java/com/microsoft/playwright/TestPageSetInputFiles.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ void shouldUploadAFolder(@TempDir Path tmpDir) throws IOException {
451451
List<String> relativePathsSorted = new ArrayList<>(webkitRelativePaths);
452452
relativePathsSorted.sort(String::compareTo);
453453
// https://issues.chromium.org/issues/345393164
454-
if (isChromium() && !isHeadful() && chromiumVersionLessThan(browser.version(), "127.0.6533.0")) {
454+
if (isChromium() && !isHeaded() && chromiumVersionLessThan(browser.version(), "127.0.6533.0")) {
455455
assertEquals(asList("file-upload-test/file1.txt", "file-upload-test/file2"), relativePathsSorted);
456456
} else {
457457
assertEquals(asList("file-upload-test/file1.txt", "file-upload-test/file2", "file-upload-test/sub-dir/really.txt"), relativePathsSorted);

playwright/src/test/java/com/microsoft/playwright/TestRequestFulfill.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ void shouldWorkWithStatusCode422() {
5555
assertEquals("Yo, page!", page.evaluate("document.body.textContent"));
5656
}
5757

58-
static boolean isFirefoxHeadful() {
59-
return isFirefox() && isHeadful();
58+
static boolean isFirefoxHeaded() {
59+
return isFirefox() && isHeaded();
6060
}
6161

6262
@Test
63-
@DisabledIf(value="isFirefoxHeadful", disabledReason="skip")
63+
@DisabledIf(value="isFirefoxHeaded", disabledReason="skip")
6464
void shouldAllowMockingBinaryResponses() {
6565
page.route("**/*", route -> {
6666
byte[] imageBuffer;
@@ -85,9 +85,9 @@ void shouldAllowMockingBinaryResponses() {
8585
}
8686

8787
@Test
88-
@DisabledIf(value="isFirefoxHeadful", disabledReason="skip")
88+
@DisabledIf(value="isFirefoxHeaded", disabledReason="skip")
8989
void shouldAllowMockingSvgWithCharset() {
90-
// Firefox headful produces a different image.
90+
// Firefox headed produces a different image.
9191
page.route("**/*", route -> {
9292
route.fulfill(new Route.FulfillOptions()
9393
.setContentType("image/svg+xml ; charset=utf-8")

0 commit comments

Comments
 (0)