feat(firefox): introduce async stacks for Puppeteer-Firefox (#3948)

This patch refactors Puppeteer-Firefox code to declare public
API in `/lib/api.js` and use it to setup async stack hooks
over the public API method calls.
This commit is contained in:
Andrey Lushnikov
2019-02-07 15:18:43 -08:00
committed by GitHub
parent 9216056d12
commit 6b18e8cef5
9 changed files with 93 additions and 48 deletions

View File

@@ -79,7 +79,7 @@ module.exports.addTests = function({testRunner, expect, headless, Errors, Device
});
});
(asyncawait ? describe_fails_ffox : xdescribe)('Async stacks', () => {
(asyncawait ? describe : xdescribe)('Async stacks', () => {
it('should work', async({page, server}) => {
server.setRoute('/empty.html', (req, res) => {
res.statusCode = 204;
@@ -88,7 +88,7 @@ module.exports.addTests = function({testRunner, expect, headless, Errors, Device
let error = null;
await page.goto(server.EMPTY_PAGE).catch(e => error = e);
expect(error).not.toBe(null);
expect(error.message).toContain('net::ERR_ABORTED');
expect(error.stack).toContain(__filename);
});
});