Add specs for manifest.json read/parse error
This commit is contained in:
parent
a3899f17f9
commit
d1ac5dd29b
2 changed files with 13 additions and 0 deletions
|
@ -858,6 +858,18 @@ describe('browser-window module', function () {
|
||||||
w.loadURL('about:blank')
|
w.loadURL('about:blank')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('throws errors for missing manifest.json files', function () {
|
||||||
|
assert.throws(function () {
|
||||||
|
BrowserWindow.addDevToolsExtension(path.join(__dirname, 'does-not-exist'))
|
||||||
|
}, /ENOENT: no such file or directory/)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('throws errors for invalid manifest.json files', function () {
|
||||||
|
assert.throws(function () {
|
||||||
|
BrowserWindow.addDevToolsExtension(path.join(__dirname, 'fixtures', 'devtools-extensions', 'bad-manifest'))
|
||||||
|
}, /Unexpected token }/)
|
||||||
|
})
|
||||||
|
|
||||||
describe('when the devtools is docked', function () {
|
describe('when the devtools is docked', function () {
|
||||||
it('creates the extension', function (done) {
|
it('creates the extension', function (done) {
|
||||||
w.webContents.openDevTools({mode: 'bottom'})
|
w.webContents.openDevTools({mode: 'bottom'})
|
||||||
|
|
1
spec/fixtures/devtools-extensions/bad-manifest/manifest.json
vendored
Normal file
1
spec/fixtures/devtools-extensions/bad-manifest/manifest.json
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue