mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
move spec to chromium_spec
This commit is contained in:
@@ -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()', () => {
|
||||
before(function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
|
||||
@@ -7,7 +7,7 @@ const url = require('url')
|
||||
const {ipcRenderer, remote} = require('electron')
|
||||
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')
|
||||
|
||||
@@ -26,6 +26,27 @@ describe('chromium feature', () => {
|
||||
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 }))
|
||||
|
||||
describe('heap snapshot', () => {
|
||||
|
||||
Reference in New Issue
Block a user