spec: Prevent callback of beginFrameSubscription being called twice

This commit is contained in:
Cheng Zhao 2015-09-21 11:24:05 +08:00
parent 35fc8885de
commit be600fda55

View file

@ -306,8 +306,11 @@ describe 'browser-window module', ->
describe 'beginFrameSubscription method', ->
it 'subscribes frame updates', (done) ->
called = false
w.loadUrl "file://#{fixtures}/api/blank.html"
w.webContents.beginFrameSubscription (data) ->
return if called
called = true
assert.notEqual data.length, 0
w.webContents.endFrameSubscription()
done()