Commit 77df41c0 authored by Mike West's avatar Mike West Committed by Commit Bot

Update cookie WPT expectations to support nameless cookies.

Based on the discussion in [1], we should change the spec to support
nameless cookies parsed from headers like `Set-Cookie: foo`. This patch
updates the WPT expectations accordingly.

[1]: https://github.com/httpwg/http-extensions/issues/159

Bug: 1037996
Change-Id: Iefabea524377857d524c74457153347a107401ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982551Reviewed-by: default avatarLily Chen <chlily@chromium.org>
Commit-Queue: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729807}
parent 49a6c330
This is a testharness.js-based test.
PASS 0001 - Set cookie.
PASS 0002 - Set cookie with future expiration.
PASS 0003 - Set expired cookie along with valid cookie.
FAIL 0004 - Ignore cookie without key. assert_equals: expected "" but got "foo"
PASS 0005 - Set cookie with age.
PASS 0006 - Set no cookie with max-age=0.
PASS 0007 - Set cookie with version=1.
PASS 0008 - Set cookie with version=1000.
PASS 0009 - Set cookie with custom value.
PASS 0010 - Dont accept 'secure' cookies over http.
PASS 0011 - Ignore separators in cookie values.
PASS 0012 - Ignore values with separators and without ';'.
PASS 0013 - Use last value for cookies with identical keys.
PASS 0014 - Keep alphabetic key order.
PASS 0015 - Keep alphabetic single-char key order.
PASS 0016 - Keep non-alphabetic key order.
PASS 0017 - Keep order if comma-separated.
PASS 0018 - Ignore keys after semicolon.
PASS 0019 - Ignore attributes after semicolon.
PASS 0020 - Ignore cookies without key and value.
FAIL 0021 - Ignore cookie without key in all 'Set-Cookie'. assert_equals: expected "a=b; c=d" but got "a=b; x; c=d"
PASS 0022 - Set cookie without value in all 'Set-Cookie'.
FAIL 0023 - Ignore cookies without '=' in all 'Set-Cookie'. assert_equals: expected "" but got "foo"
FAIL 0024 - Ignore malformed cookies in all 'Set-Cookie'. assert_equals: expected "" but got "foo"
FAIL 0025 - Ignore cookies with ';' in all 'Set-Cookie'. assert_equals: expected "" but got "foo"
FAIL 0026 - Ignore malformed cookies in all 'Set-Cookie' v2. assert_equals: expected "" but got "foo"
FAIL 0027 - Ignore malformed cookies in all 'Set-Cookie' v3. assert_equals: expected "" but got "bar"
FAIL 0028 - Ignore malformed cookies in all 'Set-Cookie' v4. assert_equals: expected "" but got "foo"
Harness: the test ran to completion.
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
{file: "0001", name: "Set cookie."}, {file: "0001", name: "Set cookie."},
{file: "0002", name: "Set cookie with future expiration."}, {file: "0002", name: "Set cookie with future expiration."},
{file: "0003", name: "Set expired cookie along with valid cookie."}, {file: "0003", name: "Set expired cookie along with valid cookie."},
{file: "0004", name: "Ignore cookie without key."}, {file: "0004", name: "Set nameless cookie."},
{file: "0005", name: "Set cookie with age."}, {file: "0005", name: "Set cookie with age."},
{file: "0006", name: "Set no cookie with max-age=0."}, {file: "0006", name: "Set no cookie with max-age=0."},
{file: "0007", name: "Set cookie with version=1."}, {file: "0007", name: "Set cookie with version=1."},
...@@ -41,15 +41,15 @@ ...@@ -41,15 +41,15 @@
{file: "0017", name: "Keep order if comma-separated."}, {file: "0017", name: "Keep order if comma-separated."},
{file: "0018", name: "Ignore keys after semicolon."}, {file: "0018", name: "Ignore keys after semicolon."},
{file: "0019", name: "Ignore attributes after semicolon."}, {file: "0019", name: "Ignore attributes after semicolon."},
{file: "0020", name: "Ignore cookies without key and value."}, {file: "0020", name: "Ignore `Set-Cookie: =`."},
{file: "0021", name: "Ignore cookie without key in all 'Set-Cookie'."}, {file: "0021", name: "Set nameless cookie, given `Set-Cookie: =x`"},
{file: "0022", name: "Set cookie without value in all 'Set-Cookie'."}, {file: "0022", name: "Set valueless cookie, given `Set-Cookie: x=`"},
{file: "0023", name: "Ignore cookies without '=' in all 'Set-Cookie'."}, {file: "0023", name: "Ignore empty cookie string."},
{file: "0024", name: "Ignore malformed cookies in all 'Set-Cookie'."}, {file: "0024", name: "Ignore `Set-Cookie: =` with other `Set-Cookie` headers."},
{file: "0025", name: "Ignore cookies with ';' in all 'Set-Cookie'."}, {file: "0025", name: "Ignore name- and value-less `Set-Cookie: ; bar`."},
{file: "0026", name: "Ignore malformed cookies in all 'Set-Cookie' v2."}, {file: "0026", name: "Ignore name- and value-less `Set-Cookie: `."},
{file: "0027", name: "Ignore malformed cookies in all 'Set-Cookie' v3."}, {file: "0027", name: "Overwrite nameless cookie."},
{file: "0028", name: "Ignore malformed cookies in all 'Set-Cookie' v4."}, {file: "0028", name: "Ignore name- and value-less `Set-Cookie: \t"},
]; ];
for (const i in TEST_CASES) { for (const i in TEST_CASES) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment