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:
Andrey Lushnikov
2017-12-11 12:11:12 -08:00
committed by GitHub
parent a164524c72
commit 4eaf52fa1d
4 changed files with 30 additions and 5 deletions

View File

@@ -136,7 +136,7 @@ class Launcher {
const connectionDelay = options.slowMo || 0;
const browserWSEndpoint = await waitForWSEndpoint(chromeProcess, options.timeout || 30 * 1000);
connection = await Connection.create(browserWSEndpoint, connectionDelay);
return Browser.create(connection, options, killChrome);
return Browser.create(connection, options, chromeProcess, killChrome);
} catch (e) {
forceKillChrome();
throw e;
@@ -187,7 +187,7 @@ class Launcher {
*/
static async connect(options = {}) {
const connection = await Connection.create(options.browserWSEndpoint);
return Browser.create(connection, options, () => connection.send('Browser.close'));
return Browser.create(connection, options, null, () => connection.send('Browser.close'));
}
}