Don't run it statements when OSR is disabled
This commit is contained in:
parent
2007f3cb99
commit
449776f228
1 changed files with 13 additions and 16 deletions
|
@ -2555,8 +2555,19 @@ describe('BrowserWindow module', function () {
|
|||
})
|
||||
|
||||
describe('offscreen rendering', function () {
|
||||
const createWindow = function() {
|
||||
return new BrowserWindow({
|
||||
const isOffscreenRenderingDisabled = () => {
|
||||
const contents = webContents.create({})
|
||||
const disabled = typeof contents.isOffscreen !== 'function'
|
||||
contents.destroy()
|
||||
return disabled
|
||||
}
|
||||
|
||||
// Offscreen rendering can be disabled in the build
|
||||
if (isOffscreenRenderingDisabled()) return
|
||||
|
||||
beforeEach(function () {
|
||||
if (w != null) w.destroy()
|
||||
w = new BrowserWindow({
|
||||
width: 100,
|
||||
height: 100,
|
||||
show: false,
|
||||
|
@ -2565,20 +2576,6 @@ describe('BrowserWindow module', function () {
|
|||
offscreen: true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
before(function() {
|
||||
const w = createWindow()
|
||||
this.osrIsAvailable = ('isOffscreen' in w.webContents)
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
if (!this.osrIsAvailable) {
|
||||
this.skip()
|
||||
}
|
||||
|
||||
if (w != null) w.destroy()
|
||||
w = createWindow()
|
||||
})
|
||||
|
||||
it('creates offscreen window with correct size', function (done) {
|
||||
|
|
Loading…
Reference in a new issue