2019-11-06 16:15:55 -08:00
|
|
|
const { expect } = require('chai')
|
2019-10-11 10:20:08 -07:00
|
|
|
const { webFrame } = require('electron')
|
2018-07-10 12:43:39 -07:00
|
|
|
|
2016-03-25 13:03:49 -07:00
|
|
|
describe('webFrame module', function () {
|
2019-02-09 06:38:31 +09: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 13:03:49 -07:00
|
|
|
})
|