build: fix for "enable_desktop_capturer = false" (#23864)
This commit is contained in:
parent
f67aff2704
commit
4133c71105
5 changed files with 83 additions and 12 deletions
|
@ -7,12 +7,20 @@ import { closeAllWindows } from './window-helpers';
|
|||
|
||||
const features = process.electronBinding('features');
|
||||
|
||||
ifdescribe(features.isDesktopCapturerEnabled() && !process.arch.includes('arm') && process.platform !== 'win32')('desktopCapturer', () => {
|
||||
ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('desktopCapturer', () => {
|
||||
if (!features.isDesktopCapturerEnabled()) {
|
||||
// This condition can't go the `ifdescribe` call because its inner code
|
||||
// it still executed, and if the feature is disabled some function calls here fail.
|
||||
return;
|
||||
}
|
||||
|
||||
let w: BrowserWindow;
|
||||
|
||||
before(async () => {
|
||||
w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } });
|
||||
await w.loadURL('about:blank');
|
||||
});
|
||||
|
||||
after(closeAllWindows);
|
||||
|
||||
const getSources: typeof desktopCapturer.getSources = (options: SourcesOptions) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue