blob: 8c7aa52eabd41257e6df5d26b201982f3b7288fa [file] [log] [blame]
(async function(testRunner) {
var {page, session, dp} = await testRunner.startURL(
'resources/simple.html',
`Tests that interceptor has access to the Cookie header.`);
await session.protocol.Network.enable();
await session.protocol.Runtime.enable();
await dp.Network.setRequestInterception({patterns: [{}]});
dp.Network.onRequestIntercepted(e => {
testRunner.log('Cookie: ' + e.params.request.headers['Cookie']);
dp.Network.continueInterceptedRequest({interceptionId: e.params.interceptionId});
});
await session.evaluateAsync(`document.cookie = 'foo=bar';`);
dp.Page.reload();
await dp.Network.onceLoadingFinished();
testRunner.completeTest();
})