test: cleanup newly added test for navigation referer (#3179)
Make sure that referer that is passed as `page.goto` option doesn't override subrequest referers.
This commit is contained in:
parent
2de5a42d1f
commit
22c0ce63ce
@ -755,15 +755,16 @@ module.exports.addTests = function({testRunner, expect, headless}) {
|
|||||||
expect(error.message).toContain(url);
|
expect(error.message).toContain(url);
|
||||||
});
|
});
|
||||||
it('should send referer', async({page, server}) => {
|
it('should send referer', async({page, server}) => {
|
||||||
await page.setRequestInterception(true);
|
const [request1, request2] = await Promise.all([
|
||||||
page.on('request', request => request.continue());
|
|
||||||
const [request] = await Promise.all([
|
|
||||||
server.waitForRequest('/grid.html'),
|
server.waitForRequest('/grid.html'),
|
||||||
|
server.waitForRequest('/digits/1.png'),
|
||||||
page.goto(server.PREFIX + '/grid.html', {
|
page.goto(server.PREFIX + '/grid.html', {
|
||||||
referer: 'http://google.com/',
|
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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user