Revert "feat(Page): teach Page.setContent to wait for resources to load (#1152)" (#1312)

This reverts commit 80ee469429.

Lifecycle events are not ready yet to support the setContent scenario.
The prerequisite for this is
https://chromium-review.googlesource.com/c/chromium/src/+/747805 that
might not land soon due to technical concerns.
This commit is contained in:
Andrey Lushnikov
2017-11-07 14:18:05 -08:00
committed by GitHub
parent b58d319926
commit cbe3dc58a2
3 changed files with 9 additions and 31 deletions

View File

@@ -2302,17 +2302,6 @@ describe('Page', function() {
const result = await page.content();
expect(result).toBe(`${doctype}${expectedOutput}`);
}));
it('should await resources to load', SX(async function() {
const imgPath = '/img.png';
let imgResponse = null;
server.setRoute(imgPath, (req, res) => imgResponse = res);
let loaded = false;
const contentPromise = page.setContent(`<img src="${PREFIX + imgPath}"></img>`).then(() => loaded = true);
await server.waitForRequest(imgPath);
expect(loaded).toBe(false);
imgResponse.end();
await contentPromise;
}));
});
describe('Network Events', function() {