fix: create a window capturer correctly (backport: 3-0-x) (#13693)

* fix: create a window capturer correctly

We were incorrectly creating two screen capturers instead of a window
capturer

* spec: ensure dc tests pass

* spec: enable all tests after verifying dc tests work
This commit is contained in:
trop[bot] 2018-07-17 15:30:33 +10:00 committed by Samuel Attard
parent b49b071a1f
commit fcdbb8c4a7
2 changed files with 5 additions and 1 deletions

View file

@ -69,7 +69,7 @@ void StartHandlingTask(bool capture_window,
capture_screen ? content::desktop_capture::CreateScreenCapturer()
: nullptr);
std::unique_ptr<webrtc::DesktopCapturer> window_capturer(
capture_window ? content::desktop_capture::CreateScreenCapturer()
capture_window ? content::desktop_capture::CreateWindowCapturer()
: nullptr);
cap->media_list_.reset(new NativeDesktopMediaList(
std::move(screen_capturer), std::move(window_capturer)));

View file

@ -69,7 +69,11 @@ describe('desktopCapturer', () => {
return done()
}
const { BrowserWindow } = remote
const w = new BrowserWindow({ width: 200, height: 200 })
desktopCapturer.getSources({types: ['window']}, (error, sources) => {
w.destroy()
expect(error).to.be.null()
expect(sources).to.be.an('array').that.is.not.empty()
for (const {display_id: displayId} of sources) {