chore: fix promisify helper (#16544)
* chore: fix promise deprecation helper * fix deprecations * update deprecation tests
This commit is contained in:
parent
63bf370cc0
commit
5a35c3a279
12 changed files with 65 additions and 48 deletions
|
@ -266,12 +266,13 @@ describe('session module', () => {
|
|||
}
|
||||
expect(error).to.be.undefined(error)
|
||||
})
|
||||
|
||||
it('with callbacks', (done) => {
|
||||
const name = 'foo'
|
||||
const value = 'bar'
|
||||
const { cookies } = session.defaultSession
|
||||
|
||||
cookies.set({ url, name, value }, error => {
|
||||
cookies.set({ url, name, value }, (error) => {
|
||||
if (error) return done(error)
|
||||
cookies.flushStore(error => done(error))
|
||||
})
|
||||
|
@ -279,6 +280,19 @@ describe('session module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('ses.cookies.flushStore(callback)', () => {
|
||||
it('flushes the cookies to disk and invokes the callback when done', (done) => {
|
||||
session.defaultSession.cookies.set({
|
||||
url: url,
|
||||
name: 'foo',
|
||||
value: 'bar'
|
||||
}, (error) => {
|
||||
if (error) return done(error)
|
||||
session.defaultSession.cookies.flushStore(() => done())
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('should survive an app restart for persistent partition', async () => {
|
||||
const appPath = path.join(__dirname, 'fixtures', 'api', 'cookie-app')
|
||||
const electronPath = remote.getGlobal('process').execPath
|
||||
|
@ -735,7 +749,7 @@ describe('session module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('ses.setCertificateVerifyProc(callback)', () => {
|
||||
describe('ses.setCertificateVerifyProc(callback)', (done) => {
|
||||
let server = null
|
||||
|
||||
beforeEach((done) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue