mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
feat: webFrameMain.fromFrameToken (#47850)
* feat: webFrameMain.fromFrameToken * refactor: return null instead of undefined * docs: mention renderer webFrame property * chore: undo null->undefined in wfm.fromId api this will be updated in another pr
This commit is contained in:
@@ -496,6 +496,19 @@ describe('webFrameMain module', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('webFrameMain.fromFrameToken', () => {
|
||||
it('returns null for unknown IDs', () => {
|
||||
expect(webFrameMain.fromFrameToken(0, '')).to.be.null();
|
||||
});
|
||||
|
||||
it('can find existing frame', async () => {
|
||||
const w = new BrowserWindow({ show: false });
|
||||
const { mainFrame } = w.webContents;
|
||||
const frame = webFrameMain.fromFrameToken(mainFrame.processId, mainFrame.frameToken);
|
||||
expect(frame).to.equal(mainFrame);
|
||||
});
|
||||
});
|
||||
|
||||
describe('webFrameMain.collectJavaScriptCallStack', () => {
|
||||
let server: Server;
|
||||
before(async () => {
|
||||
|
||||
Reference in New Issue
Block a user