From 9782f9c82777fa4a18a4a3068f42c2c14ebb761d Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 15 Feb 2019 18:26:14 -0800 Subject: [PATCH] fix(firefox): add test to make sure remote browser can be closed (#4023) --- experimental/puppeteer-firefox/package.json | 2 +- test/launcher.spec.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/experimental/puppeteer-firefox/package.json b/experimental/puppeteer-firefox/package.json index 617f4e2366e..b91f033d499 100644 --- a/experimental/puppeteer-firefox/package.json +++ b/experimental/puppeteer-firefox/package.json @@ -9,7 +9,7 @@ "node": ">=8.9.4" }, "puppeteer": { - "firefox_revision": "c74102def6c16584c155a98741e8143ab5d615b9" + "firefox_revision": "10282bfac697c69a6fdfeec4cddae7caf98e1969" }, "scripts": { "install": "node install.js", diff --git a/test/launcher.spec.js b/test/launcher.spec.js index f21fdf69785..1342b978ea6 100644 --- a/test/launcher.spec.js +++ b/test/launcher.spec.js @@ -314,6 +314,16 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions, p expect(await secondPage.evaluate(() => 7 * 6)).toBe(42, 'original browser should still work'); await originalBrowser.close(); }); + it('should be able to close remote browser', async({server}) => { + const originalBrowser = await puppeteer.launch(defaultBrowserOptions); + const remoteBrowser = await puppeteer.connect({ + browserWSEndpoint: originalBrowser.wsEndpoint() + }); + await Promise.all([ + utils.waitEvent(originalBrowser, 'disconnected'), + remoteBrowser.close(), + ]); + }); it('should support ignoreHTTPSErrors option', async({httpsServer}) => { const originalBrowser = await puppeteer.launch(defaultBrowserOptions); const browserWSEndpoint = originalBrowser.wsEndpoint();