2019-11-07 00:15:55 +00:00
|
|
|
const { expect } = require('chai')
|
2019-10-11 17:20:08 +00:00
|
|
|
const { webFrame } = require('electron')
|
2018-07-10 19:43:39 +00:00
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
describe('webFrame module', function () {
|
2019-02-08 21:38:31 +00:00
|
|
|
it('top is self for top frame', () => {
|
|
|
|
expect(webFrame.top.context).to.equal(webFrame.context)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('opener is null for top frame', () => {
|
|
|
|
expect(webFrame.opener).to.be.null()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('firstChild is null for top frame', () => {
|
|
|
|
expect(webFrame.firstChild).to.be.null()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('getFrameForSelector() does not crash when not found', () => {
|
|
|
|
expect(webFrame.getFrameForSelector('unexist-selector')).to.be.null()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('findFrameByName() does not crash when not found', () => {
|
|
|
|
expect(webFrame.findFrameByName('unexist-name')).to.be.null()
|
|
|
|
})
|
|
|
|
|
|
|
|
it('findFrameByRoutingId() does not crash when not found', () => {
|
|
|
|
expect(webFrame.findFrameByRoutingId(-1)).to.be.null()
|
|
|
|
})
|
2016-03-25 20:03:49 +00:00
|
|
|
})
|