Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove test which is inherently racy #1313

Merged
merged 1 commit into from
Mar 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions test/page.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,27 +511,6 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
const result = await page.content();
expect(result).toBe(expectedOutput);
});
it.fail(true)('should not confuse with previous navigation', async({page, server}) => {
const imgPath = '/img.png';
let imgResponse = null;
server.setRoute(imgPath, (req, res) => imgResponse = res);
let loaded = false;
// get the global object to make sure that the main execution context is alive and well.
await page.evaluate(() => this);
// Trigger navigation which might resolve next setContent call.
const evalPromise = page.evaluate(url => window.location.href = url, server.EMPTY_PAGE);
const contentPromise = page.setContent(`<img src="${server.PREFIX + imgPath}"></img>`).then(() => loaded = true);
await server.waitForRequest(imgPath);

expect(loaded).toBe(false);
for (let i = 0; i < 5; i++)
await page.evaluate('1'); // Roundtrips to give setContent a chance to resolve.
expect(loaded).toBe(false);

imgResponse.end();
await contentPromise;
await evalPromise;
});
it('should work with doctype', async({page, server}) => {
const doctype = '<!DOCTYPE html>';
await page.setContent(`${doctype}<div>hello</div>`);
Expand Down