Require a non-empty drag image to prevent crash

This commit is contained in:
Kevin Sawicki 2017-01-26 10:38:13 -08:00
parent 8ce1930f0d
commit e683f28e32
2 changed files with 15 additions and 5 deletions

View file

@ -292,13 +292,15 @@ describe('webContents module', function () {
w.webContents.startDrag({icon: path.join(__dirname, 'fixtures', 'assets', 'logo.png')})
}, /Must specify either 'file' or 'files' option/)
assert.throws(() => {
w.webContents.startDrag({file: __filename, icon: __filename})
}, /Must specify non-empty 'icon' option/)
assert.throws(() => {
w.webContents.startDrag({file: __filename})
}, /Must specify non-empty 'icon' option/)
}, /Must specify 'icon' option/)
if (process.platform === 'darwin') {
assert.throws(() => {
w.webContents.startDrag({file: __filename, icon: __filename})
}, /Must specify non-empty 'icon' option/)
}
})
})
})