Skip to content

fix(chromedriver): get most recent version on x64 windows if multiple major versions exist #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
6 changes: 5 additions & 1 deletion lib/binaries/chrome_xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export class ChromeXml extends XmlConfigSource {
// If the semantic version is the same, check os arch.
// For 64-bit systems, prefer the 64-bit version.
else if (this.osarch === 'x64') {
if (item.includes(this.getOsTypeName() + '64')) {
// No win64 version exists, so even on x64 we need to look for win32
const osTypeNameAndArch =
this.getOsTypeName() + (this.getOsTypeName() === 'win' ? '32' : '64');

if (item.includes(osTypeNameAndArch)) {
itemFound = item;
}
}
Expand Down
13 changes: 13 additions & 0 deletions spec/binaries/chrome_xml_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ describe('chrome xml reader', () => {
});
});

// This test case covers a bug when all the following conditions were true.
// arch was 64 with multiple major versions available.
it('should not get the 85.0.4183.38, 32-bit version (arch = x64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
chromeXml.ostype = 'Windows_NT';
chromeXml.osarch = 'x64';
chromeXml.getUrl('85.0.4183.87').then((binaryUrl) => {
expect(binaryUrl.url).toContain('85.0.4183.87/chromedriver_win32.zip');
done();
});
});

it('should get the 87.0.4280.88, 64-bit, m1 version (arch = arm64)', (done) => {
let chromeXml = new ChromeXml();
chromeXml.out_dir = out_dir;
Expand Down