feat: convert webContents primitives to properties (#18998)
* feat: convert webContents primitives to properties * address feedback from review
This commit is contained in:
parent
de072c6ef5
commit
8782d06ed6
9 changed files with 152 additions and 49 deletions
|
@ -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'))
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue