fix: allow renaming electron.exe (#15173)
This commit is contained in:
parent
0c711f690e
commit
30ccb6aea5
4 changed files with 39 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
const assert = require('assert')
|
||||
const Module = require('module')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const { remote } = require('electron')
|
||||
const { BrowserWindow } = remote
|
||||
const { closeWindow } = require('./window-helpers')
|
||||
|
@ -24,6 +25,22 @@ describe('modules support', () => {
|
|||
done()
|
||||
})
|
||||
})
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
it('can be required if electron.exe is renamed', () => {
|
||||
const { execPath } = remote.process
|
||||
const testExecPath = path.join(path.dirname(execPath), 'test.exe')
|
||||
fs.copyFileSync(execPath, testExecPath)
|
||||
try {
|
||||
const runasFixture = path.join(fixtures, 'module', 'runas-renamed.js')
|
||||
assert.ok(fs.existsSync(runasFixture))
|
||||
const child = require('child_process').spawnSync(testExecPath, [runasFixture])
|
||||
assert.strictEqual(child.status, 0)
|
||||
} finally {
|
||||
fs.unlinkSync(testExecPath)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// TODO(alexeykuzmin): Disabled during the Chromium 62 (Node.js 9) upgrade.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue