Also fix setInterval for #481.
This commit is contained in:
parent
b139d97f3d
commit
382dbb500c
2 changed files with 8 additions and 0 deletions
|
@ -32,3 +32,4 @@ global.clearImmediate = timers.clearImmediate
|
||||||
# timeout in browser process.
|
# timeout in browser process.
|
||||||
if process.type is 'browser'
|
if process.type is 'browser'
|
||||||
global.setTimeout = wrapWithActivateUvLoop timers.setTimeout
|
global.setTimeout = wrapWithActivateUvLoop timers.setTimeout
|
||||||
|
global.setInterval = wrapWithActivateUvLoop timers.setInterval
|
||||||
|
|
|
@ -69,6 +69,13 @@ describe 'node feature', ->
|
||||||
it 'can be scheduled in time', (done) ->
|
it 'can be scheduled in time', (done) ->
|
||||||
remote.getGlobal('setTimeout')(done, 0)
|
remote.getGlobal('setTimeout')(done, 0)
|
||||||
|
|
||||||
|
describe 'setInterval called under Chromium event loop in browser process', ->
|
||||||
|
it 'can be scheduled in time', (done) ->
|
||||||
|
clear = ->
|
||||||
|
remote.getGlobal('clearInterval')(interval)
|
||||||
|
done()
|
||||||
|
interval = remote.getGlobal('setInterval')(clear, 0)
|
||||||
|
|
||||||
describe 'message loop', ->
|
describe 'message loop', ->
|
||||||
describe 'process.nextTick', ->
|
describe 'process.nextTick', ->
|
||||||
it 'emits the callback', (done) ->
|
it 'emits the callback', (done) ->
|
||||||
|
|
Loading…
Reference in a new issue