Require a non-empty drag image to prevent crash
This commit is contained in:
parent
8ce1930f0d
commit
e683f28e32
2 changed files with 15 additions and 5 deletions
|
@ -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/)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue