feat: promisify protocol.isProtocolHandled() (#16423)
* feat: promisify protocol * fix base::Bind and specs * update documentation * make callback-compatible * async awaitify tests
This commit is contained in:
parent
32d98851bc
commit
1f2b02c18f
7 changed files with 65 additions and 66 deletions
|
@ -524,14 +524,12 @@ describe('session module', () => {
|
|||
partitionProtocol.unregisterProtocol(protocolName, () => done())
|
||||
})
|
||||
|
||||
it('does not affect defaultSession', (done) => {
|
||||
protocol.isProtocolHandled(protocolName, (result) => {
|
||||
assert.strictEqual(result, false)
|
||||
partitionProtocol.isProtocolHandled(protocolName, (result) => {
|
||||
assert.strictEqual(result, true)
|
||||
done()
|
||||
})
|
||||
})
|
||||
it('does not affect defaultSession', async () => {
|
||||
const result1 = await protocol.isProtocolHandled(protocolName)
|
||||
assert.strictEqual(result1, false)
|
||||
|
||||
const result2 = await partitionProtocol.isProtocolHandled(protocolName)
|
||||
assert.strictEqual(result2, true)
|
||||
})
|
||||
|
||||
it('handles requests from partition', (done) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue