Skip to content

Commit

Permalink
Merge pull request #347 from WillBrock/chromedriver-236
Browse files Browse the repository at this point in the history
Update chromedriver to 2.36 and updates for linux 32
  • Loading branch information
vvo authored Mar 9, 2018
2 parents 93efc2f + 83bc90f commit 0e5e206
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
16 changes: 13 additions & 3 deletions lib/compute-download-urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function computeDownloadUrls(opts, askedOpts) {
urls.chrome,
opts.drivers.chrome.baseURL,
opts.drivers.chrome.version,
getChromeDriverPlatform(opts.drivers.chrome.arch)
getChromeDriverArchitecture(opts.drivers.chrome.version, opts.drivers.chrome.arch)
);
}
if (opts.drivers.ie) {
Expand All @@ -80,14 +80,15 @@ function computeDownloadUrls(opts, askedOpts) {
if (opts.drivers.edge) {
downloadUrls.edge = getEdgeDriverUrl(opts.drivers.edge.version);
}

return downloadUrls;
}

function getChromeDriverPlatform(wantedArchitecture) {
function getChromeDriverArchitecture(version, wantedArchitecture) {
var platform;

if (process.platform === 'linux') {
platform = 'linux' + (wantedArchitecture === 'x64' ? '64' : '32');
platform = getLinuxChromeDriverArchitecture(version, wantedArchitecture);
} else if (process.platform === 'darwin') {
if (mac32) {
platform = 'mac32';
Expand Down Expand Up @@ -172,6 +173,15 @@ function getFirefoxDriverArchitecture(version, wantedArchitecture) {
}
}

function getLinuxChromeDriverArchitecture(version, wantedArchitecture) {
// Since 2.34, chromdriver support was dropped for linux 32
if(compareVersions(version, '2.34') >= 0 && wantedArchitecture !== 'x64') {
throw new Error('Only x64 architecture is available for chromdriver >= 2.34')
}

return 'linux' + (wantedArchitecture === 'x64' ? '64' : '32');
}

function getLinuxFirefoxDriverArchitecture(version, extension, wantedArchitecture) {
// Since 0.11.0, there is linux32 and linux64
if (compareVersions(version, '0.11.0') >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
version: '3.8.1',
drivers: {
chrome: {
version: '2.33',
version: '2.36',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com'
},
Expand Down
2 changes: 1 addition & 1 deletion test/compute-download-urls-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('compute-download-urls', function() {
});
});

it('x32', function() {
it('x32 for versions < 2.34', function() {
opts.drivers.chrome = {
baseURL: 'https://localhost',
version: '2.0',
Expand Down
15 changes: 1 addition & 14 deletions test/default-downloads-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,7 @@ describe('default-downloads', function() {
});
});

it('ia32 download exists', function(done) {
opts = merge(opts, {
drivers: {
chrome: {
arch: 'ia32'
}
}
});

computedUrls = computeDownloadUrls(opts);

assert(computedUrls.chrome.indexOf('linux32') > 0);
doesDownloadExist(computedUrls.chrome, done);
});
// No x32 for latest chromedriver on linux

it('x64 download exists', function(done) {
opts = merge(opts, {
Expand Down

0 comments on commit 0e5e206

Please sign in to comment.