Skip to content

Commit

Permalink
fix(launcher): detect new Chrome 64-bit path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Aug 31, 2020
1 parent c378960 commit d558e44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/launcher/__snapshots__/windows_spec.ts.js
Expand Up @@ -176,3 +176,9 @@ exports['windows browser detection detects browsers as expected 1'] = [
}
}
]

exports['windows browser detection detects new Chrome 64-bit app path 1'] = {
"name": "chrome",
"version": "4.4.4",
"path": "C:/Program Files/Google/Chrome/Application/chrome.exe"
}
7 changes: 4 additions & 3 deletions packages/launcher/lib/windows/index.ts
Expand Up @@ -9,9 +9,10 @@ import { Browser, FoundBrowser } from '../types'
import { utils } from '../utils'

function formFullAppPath (name: string) {
const prefix = 'C:/Program Files (x86)/Google/Chrome/Application'

return [normalize(join(prefix, `${name}.exe`))]
return [
`C:/Program Files (x86)/Google/Chrome/Application/${name}.exe`,
`C:/Program Files/Google/Chrome/Application/${name}.exe`,
].map(normalize)
}

function formChromiumAppPath () {
Expand Down
8 changes: 8 additions & 0 deletions packages/launcher/test/unit/windows_spec.ts
Expand Up @@ -65,6 +65,14 @@ describe('windows browser detection', () => {
snapshot(detected)
})

// @see https://github.com/cypress-io/cypress/issues/8425
it('detects new Chrome 64-bit app path', async () => {
stubBrowser('C:/Program Files/Google/Chrome/Application/chrome.exe', '4.4.4')
const chrome = _.find(browsers, { name: 'chrome', channel: 'stable' })

snapshot(await windowsHelper.detect(chrome))
})

context('#getVersionString', () => {
it('runs wmic and returns output', async () => {
stubBrowser('foo', 'bar')
Expand Down

0 comments on commit d558e44

Please sign in to comment.