test: skip desktopCapturer / remote module tests when the features are disabled (#20566)
This commit is contained in:
parent
b085dac15b
commit
eb100cdf9e
2 changed files with 85 additions and 78 deletions
|
@ -10,6 +10,9 @@ import split = require('split')
|
|||
import { app, BrowserWindow, Menu } from 'electron'
|
||||
import { emittedOnce } from './events-helpers';
|
||||
import { closeWindow } from './window-helpers';
|
||||
import { ifdescribe } from './spec-helpers';
|
||||
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
const { expect } = chai
|
||||
|
||||
|
@ -426,6 +429,7 @@ describe('app module', () => {
|
|||
expect(webContents).to.equal(w.webContents)
|
||||
})
|
||||
|
||||
ifdescribe(features.isDesktopCapturerEnabled())('desktopCapturer module filtering', () => {
|
||||
it('should emit desktop-capturer-get-sources event when desktopCapturer.getSources() is invoked', async () => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
|
@ -441,7 +445,9 @@ describe('app module', () => {
|
|||
const [, webContents] = await promise
|
||||
expect(webContents).to.equal(w.webContents)
|
||||
})
|
||||
})
|
||||
|
||||
ifdescribe(features.isRemoteModuleEnabled())('remote module filtering', () => {
|
||||
it('should emit remote-require event when remote.require() is invoked', async () => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
|
@ -525,6 +531,7 @@ describe('app module', () => {
|
|||
expect(webContents).to.equal(w.webContents)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('app.badgeCount', () => {
|
||||
const platformIsNotSupported =
|
||||
|
|
|
@ -103,7 +103,7 @@ describe('webContents module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('webContents.print()', () => {
|
||||
ifdescribe(features.isPrintingEnabled())('webContents.print()', () => {
|
||||
afterEach(closeAllWindows)
|
||||
it('throws when invalid settings are passed', () => {
|
||||
const w = new BrowserWindow({ show: false })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue