From 16fc28bf06ad5d0f33c53fddf5a65657c5c52adc Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 10 Jan 2019 14:05:43 -0800 Subject: [PATCH] test: make sure headful browser closes with beforeuload page (#3751) This was fixed upstream at https://crrev.com/618425 Fixes #3673 --- test/headful.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/headful.spec.js b/test/headful.spec.js index cefc1d76..29ff94ad 100644 --- a/test/headful.spec.js +++ b/test/headful.spec.js @@ -121,6 +121,15 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions}) ]); await browser.close(); }); + it('should close browser with beforeunload page', async({server}) => { + const browser = await puppeteer.launch(headfulOptions); + const page = await browser.newPage(); + await page.goto(server.PREFIX + '/beforeunload.html'); + // We have to interact with a page so that 'beforeunload' handlers + // fire. + await page.click('body'); + await browser.close(); + }); }); };