Skip to content

Commit 4f5f736

Browse files
Blackbaud-BobbyEarlBobby Earllotzcnishina
authored
fix(chromedriver): get most recent version on x64 windows if multiple major versions exist (#473)
* Update spec/binaries/chrome_xml_spec.ts * Update chrome_xml_spec.ts Co-authored-by: Bobby Earl <[email protected]> Co-authored-by: Kurt Legerlotz <[email protected]> Co-authored-by: Craig Nishina <[email protected]>
1 parent 17db8a2 commit 4f5f736

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/binaries/chrome_xml.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ export class ChromeXml extends XmlConfigSource {
104104
// If the semantic version is the same, check os arch.
105105
// For 64-bit systems, prefer the 64-bit version.
106106
else if (this.osarch === 'x64') {
107-
if (item.includes(this.getOsTypeName() + '64')) {
107+
// No win64 version exists, so even on x64 we need to look for win32
108+
const osTypeNameAndArch =
109+
this.getOsTypeName() + (this.getOsTypeName() === 'win' ? '32' : '64');
110+
111+
if (item.includes(osTypeNameAndArch)) {
108112
itemFound = item;
109113
}
110114
}

spec/binaries/chrome_xml_spec.ts

+13
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ describe('chrome xml reader', () => {
6767
});
6868
});
6969

70+
// This test case covers a bug when all the following conditions were true.
71+
// arch was 64 with multiple major versions available.
72+
it('should not get the 85.0.4183.38, 32-bit version (arch = x64)', (done) => {
73+
let chromeXml = new ChromeXml();
74+
chromeXml.out_dir = out_dir;
75+
chromeXml.ostype = 'Windows_NT';
76+
chromeXml.osarch = 'x64';
77+
chromeXml.getUrl('85.0.4183.87').then((binaryUrl) => {
78+
expect(binaryUrl.url).toContain('85.0.4183.87/chromedriver_win32.zip');
79+
done();
80+
});
81+
});
82+
7083
it('should get the 87.0.4280.88, 64-bit, m1 version (arch = arm64)', (done) => {
7184
let chromeXml = new ChromeXml();
7285
chromeXml.out_dir = out_dir;

0 commit comments

Comments
 (0)