feat: convert webContents primitives to properties (#18998)

* feat: convert webContents primitives to properties

* address feedback from review
This commit is contained in:
Shelley Vohr 2019-07-03 08:57:10 -07:00 committed by GitHub
parent de072c6ef5
commit 8782d06ed6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 152 additions and 49 deletions

View file

@ -3034,6 +3034,7 @@ describe('BrowserWindow module', () => {
})
})
// TODO(codebytere): remove in Electron v8.0.0
describe('window.webContents.getFrameRate()', () => {
it('has default frame rate', (done) => {
w.webContents.once('paint', function (event, rect, data) {
@ -3044,6 +3045,7 @@ describe('BrowserWindow module', () => {
})
})
// TODO(codebytere): remove in Electron v8.0.0
describe('window.webContents.setFrameRate(frameRate)', () => {
it('sets custom frame rate', (done) => {
w.webContents.on('dom-ready', () => {
@ -3056,6 +3058,27 @@ describe('BrowserWindow module', () => {
w.loadFile(path.join(fixtures, 'api', 'offscreen-rendering.html'))
})
})
describe('window.webContents.FrameRate', () => {
it('has default frame rate', (done) => {
w.webContents.once('paint', function (event, rect, data) {
expect(w.webContents.frameRate).to.equal(60)
done()
})
w.loadFile(path.join(fixtures, 'api', 'offscreen-rendering.html'))
})
it('sets custom frame rate', (done) => {
w.webContents.on('dom-ready', () => {
w.webContents.frameRate = 30
w.webContents.once('paint', function (event, rect, data) {
expect(w.webContents.frameRate).to.equal(30)
done()
})
})
w.loadFile(path.join(fixtures, 'api', 'offscreen-rendering.html'))
})
})
})
})