feat: promisify session.clearStorageData() (#17249)

This commit is contained in:
Shelley Vohr 2019-03-08 09:02:30 -08:00 committed by GitHub
parent d34f81972d
commit bbfa63fd9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 20 deletions

View file

@ -184,7 +184,7 @@ describe('chromium feature', () => {
done()
}).catch((error) => done(error))
} else {
ses.clearStorageData(options, () => {
ses.clearStorageData(options).then(() => {
w.webContents.reload()
})
}
@ -225,7 +225,7 @@ describe('chromium feature', () => {
assert.strictEqual(message, 'Hello from serviceWorker!')
session.fromPartition('sw-file-scheme-spec').clearStorageData({
storages: ['serviceworkers']
}, () => done())
}).then(() => done())
}
})
w.webContents.on('crashed', () => done(new Error('WebContents crashed.')))
@ -264,8 +264,8 @@ describe('chromium feature', () => {
assert.strictEqual(message, 'Hello from serviceWorker!')
customSession.clearStorageData({
storages: ['serviceworkers']
}, () => {
customSession.protocol.uninterceptProtocol('file', (error) => done(error))
}).then(() => {
customSession.protocol.uninterceptProtocol('file', error => done(error))
})
}
})