Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,24 @@ Optional<URL> buildUrl(String driverVersion, Config config) {
String downloadUrlPattern = config.getChromeDownloadUrlPattern();
OperatingSystem os = config.getOperatingSystem();
Architecture arch = config.getArchitecture();
String archLabel = os.isLinux() ? "64"
: arch.toString().toLowerCase(ROOT);
if (os.isWin() && !X32.equals(arch)) {
archLabel = "64";
String archLabel = arch.toString().toLowerCase(ROOT);
String separator = "";
switch(os) {
case WIN:
archLabel = arch == X32 ? "32" : "64";
separator = "";
break;
case MAC:
archLabel = arch == ARM64 ? "arm64" : "x64";
separator = "-";
break;
case LINUX:
archLabel = arch == ARM64 ? "arm64" : "64";
separator = arch == ARM64 ? "-" : "";
break;
}
if (os.isMac() && !ARM64.equals(arch)) {
archLabel = "x64";
}
String separator = os.isMac() ? "-" : "";

String label = os.getName() + separator + archLabel;

String builtUrl = String.format(downloadUrlPattern, driverVersion,
label, label);
if (!VersionDetector.isCfT(driverVersion)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void chromeVersionOnLinux() throws MalformedURLException {
VERSION)));
assertThat(chromeDriverManager.buildUrl(VERSION, new DummyConfig(LINUX,
ARM64))).hasValue(new URL(String.format(
"https://storage.googleapis.com/chrome-for-testing-public/%s/linux64/chromedriver-linux64.zip",
"https://storage.googleapis.com/chrome-for-testing-public/%s/linux-arm64/chromedriver-linux-arm64.zip",
VERSION)));
assertThat(chromeDriverManager.buildUrl(VERSION, new DummyConfig(LINUX,
DEFAULT))).hasValue(new URL(String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,44 @@ class ChromeArmTest {

@Test
void testChromeArm() {
WebDriverManager wdm = WebDriverManager.chromedriver();
WebDriverManager wdm = WebDriverManager.chromedriver()
.clearResolutionCache()
.driverVersion("latest");

// 1. Force downloading
wdm.forceDownload();
checkArm(wdm);
checkArmOnMac(wdm);
checkArmOnLinux(wdm);

// 2. Using cache
wdm.reset();
checkArm(wdm);
wdm.driverVersion("latest");
checkArmOnMac(wdm);
checkArmOnLinux(wdm);
}

private void checkArm(WebDriverManager wdm) {
private void checkArmOnMac(WebDriverManager wdm) {
wdm.avoidBrowserDetection().mac().arch64().setup();
String driverPath = wdm.getDownloadedDriverPath();
log.debug("Driver path (X64) {}", driverPath);
log.debug("Driver path (Mac X64) {}", driverPath);

wdm.avoidBrowserDetection().mac().arm64().setup();
String driverPathArm64 = wdm.getDownloadedDriverPath();
log.debug("Driver path (ARM64) {}", driverPathArm64);
log.debug("Driver path (Mac ARM64) {}", driverPathArm64);

assertThat(driverPath).isNotEqualTo(driverPathArm64);
}

private void checkArmOnLinux(WebDriverManager wdm) {
wdm.avoidBrowserDetection().linux().arch64().setup();
String driverPath = wdm.getDownloadedDriverPath();
log.debug("Driver path (Linux X64) {}", driverPath);

wdm.avoidBrowserDetection().linux().arm64().setup();
String driverPathArm64 = wdm.getDownloadedDriverPath();
log.debug("Driver path (Linux ARM64) {}", driverPathArm64);

assertThat(driverPath).isNotEqualTo(driverPathArm64);
}

}
Loading