move spec to chromium_spec
This commit is contained in:
parent
1018cdc225
commit
e10b5e13e9
2 changed files with 22 additions and 20 deletions
|
@ -112,25 +112,6 @@ describe('app module', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('app.setLocale()', () => {
|
|
||||||
const testLocale = (locale, result, done) => {
|
|
||||||
const appPath = path.join(__dirname, 'fixtures', 'api', 'locale-check')
|
|
||||||
const electronPath = remote.getGlobal('process').execPath
|
|
||||||
let output = ''
|
|
||||||
let appProcess = ChildProcess.spawn(electronPath, [appPath, `--lang=${locale}`])
|
|
||||||
|
|
||||||
appProcess.stdout.on('data', (data) => { output += data })
|
|
||||||
appProcess.stdout.on('end', () => {
|
|
||||||
output = output.replace(/(\r\n|\n|\r)/gm, '')
|
|
||||||
assert.equal(output, result)
|
|
||||||
done()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
it('should set the locale', (done) => testLocale('fr', 'fr', done))
|
|
||||||
it('should not set an invalid locale', (done) => testLocale('asdfkl', 'en-US', done))
|
|
||||||
})
|
|
||||||
|
|
||||||
describe('app.isInApplicationsFolder()', () => {
|
describe('app.isInApplicationsFolder()', () => {
|
||||||
before(function () {
|
before(function () {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
|
|
|
@ -7,7 +7,7 @@ const url = require('url')
|
||||||
const {ipcRenderer, remote} = require('electron')
|
const {ipcRenderer, remote} = require('electron')
|
||||||
const {closeWindow} = require('./window-helpers')
|
const {closeWindow} = require('./window-helpers')
|
||||||
|
|
||||||
const {app, BrowserWindow, ipcMain, protocol, session, webContents} = remote
|
const {app, BrowserWindow, ipcMain, protocol, session, webContents, ChildProcess} = remote
|
||||||
|
|
||||||
const isCI = remote.getGlobal('isCi')
|
const isCI = remote.getGlobal('isCi')
|
||||||
|
|
||||||
|
@ -26,6 +26,27 @@ describe('chromium feature', () => {
|
||||||
listener = null
|
listener = null
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('command line switches', () => {
|
||||||
|
describe('--lang switch', () => {
|
||||||
|
const testLocale = (locale, result, done) => {
|
||||||
|
const appPath = path.join(__dirname, 'fixtures', 'api', 'locale-check')
|
||||||
|
const electronPath = remote.getGlobal('process').execPath
|
||||||
|
let output = ''
|
||||||
|
let appProcess = ChildProcess.spawn(electronPath, [appPath, `--lang=${locale}`])
|
||||||
|
|
||||||
|
appProcess.stdout.on('data', (data) => { output += data })
|
||||||
|
appProcess.stdout.on('end', () => {
|
||||||
|
output = output.replace(/(\r\n|\n|\r)/gm, '')
|
||||||
|
assert.equal(output, result)
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
it('should set the locale', (done) => testLocale('fr', 'fr', done))
|
||||||
|
it('should not set an invalid locale', (done) => testLocale('asdfkl', 'en-US', done))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
afterEach(() => closeWindow(w).then(() => { w = null }))
|
afterEach(() => closeWindow(w).then(() => { w = null }))
|
||||||
|
|
||||||
describe('heap snapshot', () => {
|
describe('heap snapshot', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue