mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(Browser): introduce browser.process() variable (#1581)
This patch adds a `browser.process()` getter to expose the child process with running browser. Fixes #1539.
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -263,6 +263,16 @@ describe('Page', function() {
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Browser.process', function() {
|
||||
it('should return child_process instance', SX(async function() {
|
||||
const process = await browser.process();
|
||||
expect(process.pid).toBeGreaterThan(0);
|
||||
const browserWSEndpoint = browser.wsEndpoint();
|
||||
const remoteBrowser = await puppeteer.connect({browserWSEndpoint});
|
||||
expect(remoteBrowser.process()).toBe(null);
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Browser.Events.disconnected', function() {
|
||||
it('should emitted when: browser gets closed, disconnected or underlying websocket gets closed', SX(async function() {
|
||||
const originalBrowser = await puppeteer.launch(defaultBrowserOptions);
|
||||
|
||||
Reference in New Issue
Block a user