spec: Prevent callback of beginFrameSubscription being called twice
authorCheng Zhao <zcbenz@gmail.com>
Mon, 21 Sep 2015 03:24:05 +0000 (11:24 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 21 Sep 2015 03:24:05 +0000 (11:24 +0800)
spec/api-browser-window-spec.coffee

index bb4d782..64e6271 100644 (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()