blob: 8a65ff3a91f1131eb0a8cf3b69955bada70d0839 [file] [log] [blame]
(async function(testRunner) {
const {page, session, dp} = await testRunner.startBlank(
`Verifies that a subresource accessing a SameSite=Lax cookie across schemes triggers a context downgrade inspector issue.\n`);
await dp.Network.enable();
await dp.Audits.enable();
await session.navigate('http://cookie.test:8000/inspector-protocol/resources/empty.html');
const setCookieUrl = 'https://cookie.test:8443/inspector-protocol/network/resources/set-cookie.php?cookie='
+ encodeURIComponent('name=value; SameSite=Lax');
await session.evaluate(`fetch('${setCookieUrl}', {method: 'POST', credentials: 'include'})`);
const issue = await dp.Audits.onceIssueAdded();
testRunner.log(issue.params, 'Inspector issue:');
testRunner.completeTest();
});