spec: Check the time when Promise's callback is called
This commit is contained in:
parent
74fa2c809d
commit
3402871741
1 changed files with 29 additions and 0 deletions
|
@ -135,3 +135,32 @@ describe 'chromium feature', ->
|
|||
else
|
||||
done('user agent is empty')
|
||||
websocket = new WebSocket("ws://127.0.0.1:#{port}")
|
||||
|
||||
describe 'Promise', ->
|
||||
it 'resolves correctly in Node.js calls', (done) ->
|
||||
document.registerElement('x-element', {
|
||||
prototype: Object.create(HTMLElement.prototype, {
|
||||
createdCallback: { value: -> }
|
||||
})
|
||||
})
|
||||
|
||||
setImmediate ->
|
||||
called = false
|
||||
Promise.resolve().then ->
|
||||
done(if called then undefined else new Error('wrong sequnce'))
|
||||
document.createElement 'x-element'
|
||||
called = true
|
||||
|
||||
it 'resolves correctly in Electron calls', (done) ->
|
||||
document.registerElement('y-element', {
|
||||
prototype: Object.create(HTMLElement.prototype, {
|
||||
createdCallback: { value: -> }
|
||||
})
|
||||
})
|
||||
|
||||
remote.getGlobal('setImmediate') ->
|
||||
called = false
|
||||
Promise.resolve().then ->
|
||||
done(if called then undefined else new Error('wrong sequnce'))
|
||||
document.createElement 'y-element'
|
||||
called = true
|
||||
|
|
Loading…
Reference in a new issue