Skip "offscreen rendering" tests if OSR is not available
This commit is contained in:
parent
da36bdfcc4
commit
25e1c5d6e7
1 changed files with 16 additions and 3 deletions
|
@ -2555,9 +2555,8 @@ describe('BrowserWindow module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('offscreen rendering', function () {
|
describe('offscreen rendering', function () {
|
||||||
beforeEach(function () {
|
const createWindow = function() {
|
||||||
if (w != null) w.destroy()
|
return new BrowserWindow({
|
||||||
w = new BrowserWindow({
|
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
show: false,
|
show: false,
|
||||||
|
@ -2566,6 +2565,20 @@ describe('BrowserWindow module', function () {
|
||||||
offscreen: true
|
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) {
|
it('creates offscreen window with correct size', function (done) {
|
||||||
|
|
Loading…
Reference in a new issue