chore: revert deprecated WebContents properties (#22640)

* chore: revert deprecated WebContents properties

* Fix failing zoomFactor test
This commit is contained in:
Shelley Vohr 2020-03-13 17:16:08 +00:00 committed by GitHub
parent 0c02d794c9
commit 1b353d1ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 124 additions and 65 deletions

View file

@ -3958,19 +3958,23 @@ describe('BrowserWindow module', () => {
})
})
// TODO(codebytere): remove in Electron v8.0.0
describe('window.webContents.getFrameRate()', () => {
it('has default frame rate', (done) => {
describe('frameRate APIs', () => {
it('has default frame rate (functions)', (done) => {
w.webContents.once('paint', function () {
expect(w.webContents.getFrameRate()).to.equal(60)
done()
})
w.loadFile(path.join(fixtures, 'api', 'offscreen-rendering.html'))
})
})
// TODO(codebytere): remove in Electron v8.0.0
describe('window.webContents.setFrameRate(frameRate)', () => {
it('has default frame rate', (done) => {
w.webContents.once('paint', function () {
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.setFrameRate(30)
@ -3981,16 +3985,6 @@ 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 () {
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', () => {