Merge pull request #5320 from deepak1556/desktopcapture_api_patch

renderer: fix desktop capture api not responding different subsequest calls
This commit is contained in:
Cheng Zhao 2016-04-28 20:14:58 +09:00
commit 850bc2d443
2 changed files with 12 additions and 1 deletions

View file

@ -89,7 +89,6 @@ void DesktopCapturer::OnSourceThumbnailChanged(int index) {
bool DesktopCapturer::OnRefreshFinished() {
Emit("finished", media_list_->GetSources());
media_list_.reset();
return false;
}

View file

@ -24,4 +24,16 @@ describe('desktopCapturer', function () {
desktopCapturer.getSources({types: ['window', 'screen']}, callback)
desktopCapturer.getSources({types: ['window', 'screen']}, callback)
})
it('responds to subsequest calls of different options', function (done) {
var callCount = 0
var callback = function (error, sources) {
callCount++
assert.equal(error, null)
if (callCount === 2) done()
}
desktopCapturer.getSources({types: ['window']}, callback)
desktopCapturer.getSources({types: ['screen']}, callback)
})
})