Merge pull request #5964 from electron/manifest-errors

Throw errors reading/parsing manifest.json files
This commit is contained in:
Cheng Zhao 2016-06-10 03:28:57 +00:00 committed by GitHub
commit ccaf837da4
3 changed files with 28 additions and 5 deletions

View file

@ -858,6 +858,18 @@ describe('browser-window module', function () {
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 () {
it('creates the extension', function (done) {
w.webContents.openDevTools({mode: 'bottom'})