Skip to content

Commit

Permalink
test: cleanup newly added test for navigation referer (#3179)
Browse files Browse the repository at this point in the history
Make sure that referer that is passed as `page.goto` option doesn't
override subrequest referers.
  • Loading branch information
aslushnikov committed Sep 4, 2018
1 parent 2de5a42 commit 22c0ce6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/page.spec.js
Expand Up @@ -755,15 +755,16 @@ module.exports.addTests = function({testRunner, expect, headless}) {
expect(error.message).toContain(url);
});
it('should send referer', async({page, server}) => {
await page.setRequestInterception(true);
page.on('request', request => request.continue());
const [request] = await Promise.all([
const [request1, request2] = await Promise.all([
server.waitForRequest('/grid.html'),
server.waitForRequest('/digits/1.png'),
page.goto(server.PREFIX + '/grid.html', {
referer: 'http://google.com/',
}),
]);
expect(request.headers['referer']).toBe('http://google.com/');
expect(request1.headers['referer']).toBe('http://google.com/');
// Make sure subresources do not inherit referer.
expect(request2.headers['referer']).toBe(server.PREFIX + '/grid.html');
});
});

Expand Down

0 comments on commit 22c0ce6

Please sign in to comment.