blob: fcc99d0f75afb318060889eff6e00298948e2c7b [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>Tests basic cookie setting functionality</title>
<meta name=help href="https://tools.ietf.org/html/rfc6265#page-8">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/cookie-http-state-template.js"></script>
</head>
<body style="background:#EEE">
<h3>Log</h3>
<div id="log" style="height:50px; overflow-y:scroll; background: #FFF">
</div>
<h3>IFrames</h3>
<div id="iframes" style="height:170px; overflow-y:scroll; background: #FFF">
</div>
<h3>Test Results</h3>
<script>
setup({ explicit_timeout: true });
const TEST_CASES = [
{file: "0001", name: "Set cookie."},
{file: "0002", name: "Set cookie with future expiration."},
{file: "0003", name: "Set expired cookie along with valid cookie."},
{file: "0004", name: "Set nameless cookie."},
{file: "0005", name: "Set cookie with age."},
{file: "0006", name: "Set no cookie with max-age=0."},
{file: "0007", name: "Set cookie with version=1."},
{file: "0008", name: "Set cookie with version=1000."},
{file: "0009", name: "Set cookie with custom value."},
// TODO(fhorschig): Could 0010 break when run on a HTTPS try server?
{file: "0010", name: "Dont accept 'secure' cookies over http."},
{file: "0011", name: "Ignore separators in cookie values."},
{file: "0012", name: "Ignore values with separators and without ';'."},
{file: "0013", name: "Use last value for cookies with identical keys."},
{file: "0014", name: "Keep alphabetic key order."},
{file: "0015", name: "Keep alphabetic single-char key order."},
{file: "0016", name: "Keep non-alphabetic key order."},
{file: "0017", name: "Keep order if comma-separated."},
{file: "0018", name: "Ignore keys after semicolon."},
{file: "0019", name: "Ignore attributes after semicolon."},
{file: "0020", name: "Ignore `Set-Cookie: =`."},
{file: "0021", name: "Set nameless cookie, given `Set-Cookie: =x`"},
{file: "0022", name: "Set valueless cookie, given `Set-Cookie: x=`"},
{file: "0023", name: "Ignore empty cookie string."},
{file: "0024", name: "Ignore `Set-Cookie: =` with other `Set-Cookie` headers."},
{file: "0025", name: "Ignore name- and value-less `Set-Cookie: ; bar`."},
{file: "0026", name: "Ignore name- and value-less `Set-Cookie: `."},
{file: "0027", name: "Overwrite nameless cookie."},
{file: "0028", name: "Ignore name- and value-less `Set-Cookie: \t"},
];
for (const i in TEST_CASES) {
const t = TEST_CASES[i];
promise_test(createCookieTest(t.file),
t.file + " - " + t.name);
}
</script>
</body>
</html>