api-web-frame-spec.js 936 B

1234567891011121314151617181920212223242526272829303132
  1. const chai = require('chai');
  2. const dirtyChai = require('dirty-chai');
  3. const { webFrame } = require('electron');
  4. const { expect } = chai;
  5. chai.use(dirtyChai);
  6. describe('webFrame module', function () {
  7. it('top is self for top frame', () => {
  8. expect(webFrame.top.context).to.equal(webFrame.context);
  9. });
  10. it('opener is null for top frame', () => {
  11. expect(webFrame.opener).to.be.null();
  12. });
  13. it('firstChild is null for top frame', () => {
  14. expect(webFrame.firstChild).to.be.null();
  15. });
  16. it('getFrameForSelector() does not crash when not found', () => {
  17. expect(webFrame.getFrameForSelector('unexist-selector')).to.be.null();
  18. });
  19. it('findFrameByName() does not crash when not found', () => {
  20. expect(webFrame.findFrameByName('unexist-name')).to.be.null();
  21. });
  22. it('findFrameByRoutingId() does not crash when not found', () => {
  23. expect(webFrame.findFrameByRoutingId(-1)).to.be.null();
  24. });
  25. });