Skip to content

Commit

Permalink
test: Add test for waitForFunction with cross-process navigation (#3826)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU authored and aslushnikov committed Jan 22, 2019
1 parent 9fd4b67 commit 9fb89e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/waittask.spec.js
Expand Up @@ -172,6 +172,19 @@ module.exports.addTests = function({testRunner, expect, product}) {
await page.evaluate(() => window.__injected = true);
await watchdog;
});
it('should survive cross-process navigation', async({page, server}) => {
let fooFound = false;
const waitForFunction = page.waitForFunction('window.__FOO === 1').then(() => fooFound = true);
await page.goto(server.EMPTY_PAGE);
expect(fooFound).toBe(false);
await page.reload();
expect(fooFound).toBe(false);
await page.goto(server.CROSS_PROCESS_PREFIX + '/grid.html');
expect(fooFound).toBe(false);
await page.evaluate(() => window.__FOO = 1);
await waitForFunction;
expect(fooFound).toBe(true);
});
});

describe('Frame.waitForSelector', function() {
Expand Down

0 comments on commit 9fb89e1

Please sign in to comment.