Adjust to the new behaviors of beforeunload handler

This commit is contained in:
Cheng Zhao 2016-05-23 13:28:16 +09:00
parent 06800940ec
commit fa0ce7ad5f
5 changed files with 8 additions and 29 deletions

View file

@ -476,18 +476,11 @@ describe('browser-window module', function () {
})
describe('beforeunload handler', function () {
it('returning true would not prevent close', function (done) {
it('returning undefined would not prevent close', function (done) {
w.on('closed', function () {
done()
})
w.loadURL('file://' + path.join(fixtures, 'api', 'close-beforeunload-true.html'))
})
it('returning non-empty string would not prevent close', function (done) {
w.on('closed', function () {
done()
})
w.loadURL('file://' + path.join(fixtures, 'api', 'close-beforeunload-string.html'))
w.loadURL('file://' + path.join(fixtures, 'api', 'close-beforeunload-undefined.html'))
})
it('returning false would prevent close', function (done) {