fix(browser): ensure first page is created when browser is launched (#2658)

It's impossible to launch chromium without initial page.
This patch makes sure that `puppeteer.launch()` always returns a browser
with at least one page user can connect to.
This commit is contained in:
Andrey Lushnikov
2018-06-01 13:57:50 -07:00
committed by GitHub
parent 07b91f61a9
commit 9955a1e673
2 changed files with 23 additions and 1 deletions

View File

@@ -218,6 +218,7 @@ module.exports.addTests = function({testRunner, expect, PROJECT_ROOT, defaultBro
it('should support the pipe option', async() => {
const options = Object.assign({pipe: true}, defaultBrowserOptions);
const browser = await puppeteer.launch(options);
expect((await browser.pages()).length).toBe(1);
expect(browser.wsEndpoint()).toBe('');
const page = await browser.newPage();
expect(await page.evaluate('11 * 11')).toBe(121);