Fix indent in api-crash-reporter-spec.js
This commit is contained in:
parent
5ee6205c0a
commit
a5eef516a7
1 changed files with 66 additions and 66 deletions
|
@ -16,83 +16,83 @@ describe('crashReporter module', function () {
|
||||||
}
|
}
|
||||||
var fixtures = path.resolve(__dirname, 'fixtures')
|
var fixtures = path.resolve(__dirname, 'fixtures')
|
||||||
const generateSpecs = (description, browserWindowOpts) => {
|
const generateSpecs = (description, browserWindowOpts) => {
|
||||||
describe(description, function () {
|
describe(description, function () {
|
||||||
var w = null
|
var w = null
|
||||||
var originalTempDirectory = null
|
var originalTempDirectory = null
|
||||||
var tempDirectory = null
|
var tempDirectory = null
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
w = new BrowserWindow(Object.assign({
|
w = new BrowserWindow(Object.assign({
|
||||||
show: false
|
show: false
|
||||||
}, browserWindowOpts))
|
}, browserWindowOpts))
|
||||||
tempDirectory = temp.mkdirSync('electronCrashReporterSpec-')
|
tempDirectory = temp.mkdirSync('electronCrashReporterSpec-')
|
||||||
originalTempDirectory = app.getPath('temp')
|
originalTempDirectory = app.getPath('temp')
|
||||||
app.setPath('temp', tempDirectory)
|
app.setPath('temp', tempDirectory)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
app.setPath('temp', originalTempDirectory)
|
app.setPath('temp', originalTempDirectory)
|
||||||
return closeWindow(w).then(function () { w = null })
|
return closeWindow(w).then(function () { w = null })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should send minidump when renderer crashes', function (done) {
|
it('should send minidump when renderer crashes', function (done) {
|
||||||
if (process.env.APPVEYOR === 'True') return done()
|
if (process.env.APPVEYOR === 'True') return done()
|
||||||
if (process.env.TRAVIS === 'true') return done()
|
if (process.env.TRAVIS === 'true') return done()
|
||||||
|
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
startServer({
|
startServer({
|
||||||
callback (port) {
|
callback (port) {
|
||||||
const crashUrl = url.format({
|
const crashUrl = url.format({
|
||||||
protocol: 'file',
|
protocol: 'file',
|
||||||
pathname: path.join(fixtures, 'api', 'crash.html'),
|
pathname: path.join(fixtures, 'api', 'crash.html'),
|
||||||
search: '?port=' + port
|
search: '?port=' + port
|
||||||
|
})
|
||||||
|
w.loadURL(crashUrl)
|
||||||
|
},
|
||||||
|
processType: 'renderer',
|
||||||
|
done: done
|
||||||
})
|
})
|
||||||
w.loadURL(crashUrl)
|
})
|
||||||
},
|
|
||||||
processType: 'renderer',
|
|
||||||
done: done
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should send minidump when node processes crash', function (done) {
|
it('should send minidump when node processes crash', function (done) {
|
||||||
if (process.env.APPVEYOR === 'True') return done()
|
if (process.env.APPVEYOR === 'True') return done()
|
||||||
if (process.env.TRAVIS === 'true') return done()
|
if (process.env.TRAVIS === 'true') return done()
|
||||||
|
|
||||||
this.timeout(120000)
|
this.timeout(120000)
|
||||||
|
|
||||||
startServer({
|
startServer({
|
||||||
callback (port) {
|
callback (port) {
|
||||||
const crashesDir = path.join(app.getPath('temp'), `${app.getName()} Crashes`)
|
const crashesDir = path.join(app.getPath('temp'), `${app.getName()} Crashes`)
|
||||||
const version = app.getVersion()
|
const version = app.getVersion()
|
||||||
const crashPath = path.join(fixtures, 'module', 'crash.js')
|
const crashPath = path.join(fixtures, 'module', 'crash.js')
|
||||||
childProcess.fork(crashPath, [port, version, crashesDir], {silent: true})
|
childProcess.fork(crashPath, [port, version, crashesDir], {silent: true})
|
||||||
},
|
},
|
||||||
processType: 'browser',
|
processType: 'browser',
|
||||||
done: done
|
done: done
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should send minidump with updated extra parameters', function (done) {
|
|
||||||
if (process.env.APPVEYOR === 'True') return done()
|
|
||||||
if (process.env.TRAVIS === 'true') return done()
|
|
||||||
|
|
||||||
this.timeout(10000)
|
|
||||||
|
|
||||||
startServer({
|
|
||||||
callback (port) {
|
|
||||||
const crashUrl = url.format({
|
|
||||||
protocol: 'file',
|
|
||||||
pathname: path.join(fixtures, 'api', 'crash-restart.html'),
|
|
||||||
search: '?port=' + port
|
|
||||||
})
|
})
|
||||||
w.loadURL(crashUrl)
|
})
|
||||||
},
|
|
||||||
processType: 'renderer',
|
it('should send minidump with updated extra parameters', function (done) {
|
||||||
done: done
|
if (process.env.APPVEYOR === 'True') return done()
|
||||||
|
if (process.env.TRAVIS === 'true') return done()
|
||||||
|
|
||||||
|
this.timeout(10000)
|
||||||
|
|
||||||
|
startServer({
|
||||||
|
callback (port) {
|
||||||
|
const crashUrl = url.format({
|
||||||
|
protocol: 'file',
|
||||||
|
pathname: path.join(fixtures, 'api', 'crash-restart.html'),
|
||||||
|
search: '?port=' + port
|
||||||
|
})
|
||||||
|
w.loadURL(crashUrl)
|
||||||
|
},
|
||||||
|
processType: 'renderer',
|
||||||
|
done: done
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generateSpecs('without sandbox', {})
|
generateSpecs('without sandbox', {})
|
||||||
|
|
Loading…
Reference in a new issue