Merge pull request #6983 from electron/download-item-prompt
Check DownloadItem save path before prompting
This commit is contained in:
commit
cd469b5f31
3 changed files with 39 additions and 19 deletions
|
@ -319,6 +319,17 @@ describe('session module', function () {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('when a save path is specified and the URL is unavailable', function () {
|
||||
it('does not display a save dialog and reports the done state as interrupted', function (done) {
|
||||
ipcRenderer.sendSync('set-download-option', false, false)
|
||||
ipcRenderer.once('download-done', (event, state) => {
|
||||
assert.equal(state, 'interrupted')
|
||||
done()
|
||||
})
|
||||
w.webContents.downloadURL('file://' + path.join(__dirname, 'does-not-exist.txt'))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('ses.protocol', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue