Skip "offscreen rendering" tests if OSR is not available

This commit is contained in:
Aleksei Kuzmin 2017-06-26 11:08:51 +02:00
parent da36bdfcc4
commit 25e1c5d6e7

View file

@ -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) {