<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * 10.1.2
* **Operating System:**
  * Ubuntu 18.04.5 LTS

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
`desktopCapturer.getSources().then` should be resolved

### Actual Behavior
`desktopCapturer.getSources().then` is not resolved after 1 minute

### To Reproduce
```js
const { app, desktopCapturer, screen } = require('electron');

const fs = require('fs')
const path = require('path')


function takeScreenshot() {
	console.log('Gathering screens...')
	const thumbSize = determineScreenShotSize()
	const options = { types: ['screen'], thumbnailSize: thumbSize }

	desktopCapturer.getSources(options).then((sources) => {
		console.log('Sources received:'+sources.length);
		sources.forEach(function (source) {
			const sourceName = source.name.toLowerCase();
			console.log(sourceName);
			if ( ['entire screen', 'screen 1'].includes(sourceName)) {
				const screenshotPath = path.join(app.getPath('pictures'), 'screenshot-' + new Date().toJSON() + '.png')
				fs.writeFile(screenshotPath, source.thumbnail.toPNG(), function (error) {
					if (error) return console.log(error)
					console.log('Saved screenshot to: ' + screenshotPath);
				})
			}
		})
	}).catch(console.error);
}

function determineScreenShotSize() {
	var screenSize = screen.getPrimaryDisplay().workAreaSize
	return {
		width: screenSize.width,
		height: screenSize.height
	}
}
setInterval(takeScreenshot, 15000);
```

<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->

<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

```sh
git clone git@bitbucket.org:praveen-knackforge/electron-boilerplate.git -b screenshot
npm install
npm start || electron .
```

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->
![image](https://user-images.githubusercontent.com/14850417/94028581-93587580-fdd9-11ea-9adb-52d6ab5e92f8.png)


### Additional Information
I used `desktopCapturer` API from the main process
shell/browser/api/electron_api_desktop_capturer.h
void OnSourceRemoved(DesktopMediaList* list, int index) override {}
  void OnSourceMoved(DesktopMediaList* list,
                     int old_index,
                     int new_index) override {}
  void OnSourceNameChanged(DesktopMediaList* list, int index) override {}
  void OnSourceThumbnailChanged(DesktopMediaList* list, int index) override {}
  void OnSourceUnchanged(DesktopMediaList* list) override;
 private:
  void UpdateSourcesList(DesktopMediaList* list);
  std::unique_ptr<DesktopMediaList> window_capturer_;
  std::unique_ptr<DesktopMediaList> screen_capturer_;
  std::vector<DesktopCapturer::Source> captured_sources_;
  bool capture_window_ = false;
  bool capture_screen_ = false;
  bool fetch_window_icons_ = false;
#if defined(OS_WIN)
  bool using_directx_capturer_ = false;
#endif  
  base::WeakPtrFactory<DesktopCapturer> weak_ptr_factory_{this};
  DISALLOW_COPY_AND_ASSIGN(DesktopCapturer);
};
}  
}  
#endif