feat: add osProcessId / name properties to webFrameMain (#26093)

* feat: add osProcessId / name properties to webFrameMain

* Update docs/api/web-frame-main.md

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
Milan Burda
2020-10-26 04:03:34 +01:00
committed by GitHub
parent 30b5e15ddc
commit aa157c3f05
7 changed files with 32 additions and 18 deletions

View File

@@ -216,7 +216,7 @@ ifdescribe(process.platform !== 'linux')('cross-site frame sandboxing', () => {
await w.loadURL(serverUrl);
const pidMain = w.webContents.getOSProcessId();
const pidFrame = (w.webContents as any)._getOSProcessIdForFrame('frame', crossSiteUrl);
const pidFrame = w.webContents.mainFrame.frames.find(f => f.name === 'frame')!.osProcessId;
const metrics = app.getAppMetrics();
const isProcessSandboxed = function (pid: number) {

View File

@@ -127,6 +127,8 @@ describe('webFrameMain module', () => {
await w.loadFile(path.join(subframesPath, 'frame.html'));
const webFrame = w.webContents.mainFrame;
expect(webFrame).to.haveOwnProperty('frameTreeNodeId');
expect(webFrame).to.haveOwnProperty('name');
expect(webFrame).to.haveOwnProperty('osProcessId');
expect(webFrame).to.haveOwnProperty('processId');
expect(webFrame).to.haveOwnProperty('routingId');
});