Files
ladybird/Tests/LibWeb/Text/input/cookie-file.html
Shannon Booth 5bbd3c9d31 Tests/LibWeb: Split cookies test into two
To allow for a future change where one test will be loaded over
HTTP (allowing us to remove the internals hook), and another test
which verifies cookies do not work for file URLs.
2026-02-21 23:00:57 +01:00

24 lines
695 B
HTML

<!DOCTYPE html>
<script src="include.js"></script>
<script>
const printCookies = label => {
// There's no specified order for multiple cookies, and it's a bit non-deterministic in our implementation.
// Sort the cookies alphabetically here for ease of testing.
const cookies = document.cookie.split("; ").sort().join("; ");
println(`${label}: "${cookies}"`);
};
const deleteCookie = name => {
document.cookie = `${name}=""; max-age=-9999`;
};
const cookieAverseTest = () => {
document.cookie = "cookie=value";
printCookies("Cookie averse test");
};
test(() => {
cookieAverseTest();
});
</script>