feat: support Response.buffer(), Response.json() and Response.text() (#4063)

This patch:
- implements Response.buffer() and other methods
- splits out relevant tests into a separate test suites
- implements `testServer.enableGzip()` method to optionally gzip
  certain routes in tests
- adds tests to make sure `Response.text()` returns expected results
  for binary and compressed responses.
This commit is contained in:
Andrey Lushnikov
2019-02-24 19:31:35 -08:00
committed by GitHub
parent 3bea5d6017
commit 56dafd7424
6 changed files with 153 additions and 57 deletions

View File

@@ -499,7 +499,7 @@ module.exports.addTests = function({testRunner, expect, Errors, CHROME}) {
const error = await navigationPromise;
expect(error.message).toBe('Navigating frame was detached');
});
it_fails_ffox('should return matching responses', async({page, server}) => {
it('should return matching responses', async({page, server}) => {
// Disable cache: otherwise, chromium will cache similar requests.
await page.setCacheEnabled(false);
await page.goto(server.EMPTY_PAGE);