update osr specs
This commit is contained in:
parent
af2c5d1845
commit
802501fb04
1 changed files with 11 additions and 6 deletions
|
@ -2272,6 +2272,8 @@ describe('BrowserWindow module', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
if (w != null) w.destroy()
|
if (w != null) w.destroy()
|
||||||
w = new BrowserWindow({
|
w = new BrowserWindow({
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
show: false,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
|
@ -2280,9 +2282,12 @@ describe('BrowserWindow module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('creates offscreen window', function (done) {
|
it('creates offscreen window with correct size', function (done) {
|
||||||
w.webContents.once('paint', function (event, rect, data, size) {
|
w.webContents.once('paint', function (event, rect, data) {
|
||||||
assert.notEqual(data.length, 0)
|
assert.notEqual(data.length, 0)
|
||||||
|
let size = data.getSize()
|
||||||
|
assertWithinDelta(size.width, 100, 2, 'width')
|
||||||
|
assertWithinDelta(size.height, 100, 2, 'height')
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
w.loadURL('file://' + fixtures + '/api/offscreen-rendering.html')
|
w.loadURL('file://' + fixtures + '/api/offscreen-rendering.html')
|
||||||
|
@ -2303,7 +2308,7 @@ describe('BrowserWindow module', function () {
|
||||||
|
|
||||||
describe('window.webContents.isPainting()', function () {
|
describe('window.webContents.isPainting()', function () {
|
||||||
it('returns whether is currently painting', function (done) {
|
it('returns whether is currently painting', function (done) {
|
||||||
w.webContents.once('paint', function (event, rect, data, size) {
|
w.webContents.once('paint', function (event, rect, data) {
|
||||||
assert.equal(w.webContents.isPainting(), true)
|
assert.equal(w.webContents.isPainting(), true)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
@ -2327,7 +2332,7 @@ describe('BrowserWindow module', function () {
|
||||||
w.webContents.on('dom-ready', function () {
|
w.webContents.on('dom-ready', function () {
|
||||||
w.webContents.stopPainting()
|
w.webContents.stopPainting()
|
||||||
w.webContents.startPainting()
|
w.webContents.startPainting()
|
||||||
w.webContents.once('paint', function (event, rect, data, size) {
|
w.webContents.once('paint', function (event, rect, data) {
|
||||||
assert.equal(w.webContents.isPainting(), true)
|
assert.equal(w.webContents.isPainting(), true)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
@ -2338,7 +2343,7 @@ describe('BrowserWindow module', function () {
|
||||||
|
|
||||||
describe('window.webContents.getFrameRate()', function () {
|
describe('window.webContents.getFrameRate()', function () {
|
||||||
it('has default frame rate', function (done) {
|
it('has default frame rate', function (done) {
|
||||||
w.webContents.once('paint', function (event, rect, data, size) {
|
w.webContents.once('paint', function (event, rect, data) {
|
||||||
assert.equal(w.webContents.getFrameRate(), 60)
|
assert.equal(w.webContents.getFrameRate(), 60)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
@ -2350,7 +2355,7 @@ describe('BrowserWindow module', function () {
|
||||||
it('sets custom frame rate', function (done) {
|
it('sets custom frame rate', function (done) {
|
||||||
w.webContents.on('dom-ready', function () {
|
w.webContents.on('dom-ready', function () {
|
||||||
w.webContents.setFrameRate(30)
|
w.webContents.setFrameRate(30)
|
||||||
w.webContents.once('paint', function (event, rect, data, size) {
|
w.webContents.once('paint', function (event, rect, data) {
|
||||||
assert.equal(w.webContents.getFrameRate(), 30)
|
assert.equal(w.webContents.getFrameRate(), 30)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue