feat: webFrameMain.fromFrameToken (#47942)
* feat: webFrameMain.fromFrameToken Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> * refactor: return null instead of undefined Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> * docs: mention renderer webFrame property Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> * chore: undo null->undefined in wfm.fromId api this will be updated in another pr Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
parent
f3774d578d
commit
a7b6145f3b
5 changed files with 55 additions and 3 deletions
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue