|
@@ -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.
|