diff --git a/spec/api-desktop-capturer-spec.js b/spec/api-desktop-capturer-spec.js index 13c6f9e2e52a..85f3f194b751 100644 --- a/spec/api-desktop-capturer-spec.js +++ b/spec/api-desktop-capturer-spec.js @@ -11,4 +11,17 @@ describe('desktopCapturer', function() { done(); }); }); + + it('does not throw an error when called twice (regression)', function(done) { + var callCount = 0; + var callback = function(error, sources) { + callCount++; + assert.equal(error, null); + assert.notEqual(sources.length, 0); + if (callCount === 2) done(); + } + + desktopCapturer.getSources({types: ['window', 'screen']}, callback); + desktopCapturer.getSources({types: ['window', 'screen']}, callback); + }) });