⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 293691 in webkit


Ignore:
Timestamp:
May 2, 2022, 3:48:00 PM (4 years ago)
Author:
achristensen@apple.com
Message:

Update some wpt tests with control characters in cookies
https://bugs.webkit.org/show_bug.cgi?id=239966
<rdar://92300855>

Reviewed by Chris Dumez.

This reflects a change in https://github.com/httpwg/http-extensions/issues/1531

  • web-platform-tests/cookies/name/name-ctl-expected.txt:
  • web-platform-tests/cookies/name/name-ctl.html:
  • web-platform-tests/cookies/resources/cookie-test.js:
  • web-platform-tests/cookies/value/value-ctl-expected.txt:
  • web-platform-tests/cookies/value/value-ctl.html:
  • web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt:
  • web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html:
Location:
trunk/LayoutTests/imported/w3c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r293689 r293691  
     12022-05-02  Alex Christensen  <achristensen@webkit.org>
     2
     3        Update some wpt tests with control characters in cookies
     4        https://bugs.webkit.org/show_bug.cgi?id=239966
     5        <rdar://92300855>
     6
     7        Reviewed by Chris Dumez.
     8
     9        This reflects a change in https://github.com/httpwg/http-extensions/issues/1531
     10
     11        * web-platform-tests/cookies/name/name-ctl-expected.txt:
     12        * web-platform-tests/cookies/name/name-ctl.html:
     13        * web-platform-tests/cookies/resources/cookie-test.js:
     14        * web-platform-tests/cookies/value/value-ctl-expected.txt:
     15        * web-platform-tests/cookies/value/value-ctl.html:
     16        * web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt:
     17        * web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html:
     18
    1192022-05-02  Oriol Brufau  <obrufau@igalia.com>
    220
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl-expected.txt

    r279585 r293691  
    11
    2 FAIL Cookie with %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test0" but got ""
    3 FAIL Cookie with %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test10" but got ""
    4 FAIL Cookie with %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test13" but got ""
     2PASS Cookie with %x0 in name is rejected.
    53PASS Cookie with %x1 in name is rejected.
    64PASS Cookie with %x2 in name is rejected.
     
    119PASS Cookie with %x7 in name is rejected.
    1210PASS Cookie with %x8 in name is rejected.
    13 FAIL Cookie with %x9 in name is rejected. assert_equals: The cookie was rejected. expected "" but got "test9\tname=9"
     11PASS Cookie with %x9 in name is accepted.
     12PASS Cookie with %xa in name is rejected.
    1413PASS Cookie with %xb in name is rejected.
    1514PASS Cookie with %xc in name is rejected.
     15PASS Cookie with %xd in name is rejected.
    1616PASS Cookie with %xe in name is rejected.
    1717PASS Cookie with %xf in name is rejected.
     
    3333PASS Cookie with %x1f in name is rejected.
    3434PASS Cookie with %x7f in name is rejected.
    35 FAIL Cookie with %x1 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
    36 FAIL Cookie with %x2 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
    37 FAIL Cookie with %x3 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
    38 FAIL Cookie with %x4 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
    39 FAIL Cookie with %x5 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
    40 FAIL Cookie with %x6 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
    41 FAIL Cookie with %x7 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
    42 FAIL Cookie with %x8 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
    43 FAIL Cookie with %x9 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
    44 FAIL Cookie with %xb after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
    45 FAIL Cookie with %xc after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
    46 FAIL Cookie with %xe after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
    47 FAIL Cookie with %xf after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
    48 FAIL Cookie with %x10 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
    49 FAIL Cookie with %x11 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
    50 FAIL Cookie with %x12 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
    51 FAIL Cookie with %x13 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
    52 FAIL Cookie with %x14 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
    53 FAIL Cookie with %x15 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
    54 FAIL Cookie with %x16 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
    55 FAIL Cookie with %x17 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
    56 FAIL Cookie with %x18 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
    57 FAIL Cookie with %x19 after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
    58 FAIL Cookie with %x1a after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
    59 FAIL Cookie with %x1b after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
    60 FAIL Cookie with %x1c after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
    61 FAIL Cookie with %x1d after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
    62 FAIL Cookie with %x1e after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
    63 FAIL Cookie with %x1f after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
    64 FAIL Cookie with %x7f after %x0 in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
    65 FAIL Cookie with %x1 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
    66 FAIL Cookie with %x2 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
    67 FAIL Cookie with %x3 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
    68 FAIL Cookie with %x4 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
    69 FAIL Cookie with %x5 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
    70 FAIL Cookie with %x6 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
    71 FAIL Cookie with %x7 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
    72 FAIL Cookie with %x8 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
    73 FAIL Cookie with %x9 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
    74 FAIL Cookie with %xb after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
    75 FAIL Cookie with %xc after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
    76 FAIL Cookie with %xe after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
    77 FAIL Cookie with %xf after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
    78 FAIL Cookie with %x10 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
    79 FAIL Cookie with %x11 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
    80 FAIL Cookie with %x12 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
    81 FAIL Cookie with %x13 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
    82 FAIL Cookie with %x14 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
    83 FAIL Cookie with %x15 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
    84 FAIL Cookie with %x16 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
    85 FAIL Cookie with %x17 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
    86 FAIL Cookie with %x18 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
    87 FAIL Cookie with %x19 after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
    88 FAIL Cookie with %x1a after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
    89 FAIL Cookie with %x1b after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
    90 FAIL Cookie with %x1c after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
    91 FAIL Cookie with %x1d after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
    92 FAIL Cookie with %x1e after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
    93 FAIL Cookie with %x1f after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
    94 FAIL Cookie with %x7f after %xa in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
    95 FAIL Cookie with %x1 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test1term" but got ""
    96 FAIL Cookie with %x2 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test2term" but got ""
    97 FAIL Cookie with %x3 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test3term" but got ""
    98 FAIL Cookie with %x4 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test4term" but got ""
    99 FAIL Cookie with %x5 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test5term" but got ""
    100 FAIL Cookie with %x6 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test6term" but got ""
    101 FAIL Cookie with %x7 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test7term" but got ""
    102 FAIL Cookie with %x8 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test8term" but got ""
    103 FAIL Cookie with %x9 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test9term" but got ""
    104 FAIL Cookie with %xb after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test11term" but got ""
    105 FAIL Cookie with %xc after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test12term" but got ""
    106 FAIL Cookie with %xe after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test14term" but got ""
    107 FAIL Cookie with %xf after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test15term" but got ""
    108 FAIL Cookie with %x10 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test16term" but got ""
    109 FAIL Cookie with %x11 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test17term" but got ""
    110 FAIL Cookie with %x12 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test18term" but got ""
    111 FAIL Cookie with %x13 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test19term" but got ""
    112 FAIL Cookie with %x14 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test20term" but got ""
    113 FAIL Cookie with %x15 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test21term" but got ""
    114 FAIL Cookie with %x16 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test22term" but got ""
    115 FAIL Cookie with %x17 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test23term" but got ""
    116 FAIL Cookie with %x18 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test24term" but got ""
    117 FAIL Cookie with %x19 after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test25term" but got ""
    118 FAIL Cookie with %x1a after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test26term" but got ""
    119 FAIL Cookie with %x1b after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test27term" but got ""
    120 FAIL Cookie with %x1c after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test28term" but got ""
    121 FAIL Cookie with %x1d after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test29term" but got ""
    122 FAIL Cookie with %x1e after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test30term" but got ""
    123 FAIL Cookie with %x1f after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test31term" but got ""
    124 FAIL Cookie with %x7f after %xd in name is truncated. assert_equals: The cookie was set as expected. expected "test127term" but got ""
    12535
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/name/name-ctl.html

    r279585 r293691  
    88    <script src="/resources/testharness.js"></script>
    99    <script src="/resources/testharnessreport.js"></script>
     10    <script src="/resources/testdriver.js"></script>
     11    <script src="/resources/testdriver-vendor.js"></script>
    1012    <script src="/cookies/resources/cookie-test.js"></script>
    1113  </head>
     
    1517      // Tests for control characters (CTLs) in a cookie's name.
    1618      // CTLs are defined by RFC 5234 to be %x00-1F / %x7F.
    17       const {TERMINATING_CTLS, CTLS} = getCtlCharacters();
     19      const CTLS = getCtlCharacters();
    1820
    19       // Start with a clean slate.
    20       dropAllDomCookies();
    21 
    22       // Test that terminating CTLs truncate the cookie string.
    23       for (const ctl of TERMINATING_CTLS) {
    24         domCookieTest(
     21      // All CTLs, with the exception of %x09 (the tab character), should
     22      // cause the cookie to be rejected.
     23      for (const ctl of CTLS) {
     24        if (ctl.code === 0x09) {
     25          domCookieTest(
    2526            `test${ctl.code}${ctl.chr}name=${ctl.code}`,
    26             `test${ctl.code}`,
    27             `Cookie with %x${ctl.code.toString(16)} in name is truncated.`);
    28       }
    29 
    30       // Test that other CTLs result in cookie rejection.
    31       for (const ctl of CTLS) {
    32         domCookieTest(
     27            `test${ctl.code}${ctl.chr}name=${ctl.code}`,
     28            `Cookie with %x${ctl.code.toString(16)} in name is accepted.`);
     29        } else {
     30          domCookieTest(
    3331            `test${ctl.code}${ctl.chr}name=${ctl.code}`,
    3432            '',
    3533            `Cookie with %x${ctl.code.toString(16)} in name is rejected.`);
    36       }
    37 
    38       // Test that truncation due to terminating CTLs occurs first.
    39       for (const termCtl of TERMINATING_CTLS) {
    40         for (const ctl of CTLS) {
    41           domCookieTest(
    42               `test${ctl.code}term${termCtl.chr}na${ctl.chr}me=${ctl.code}`,
    43               `test${ctl.code}term`,
    44               `Cookie with %x${ctl.code.toString(16)} after ` +
    45                   `%x${termCtl.code.toString(16)} in name is truncated.`);
    4634        }
    4735      }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/resources/cookie-test.js

    r279585 r293691  
    152152}
    153153
    154 // Returns two arrays of control characters along with their ASCII codes. The
    155 // TERMINATING_CTLS should result in termination of the cookie string. The
    156 // remaining CTLS should result in rejection of the cookie. Control characters
    157 // are defined by RFC 5234 to be %x00-1F / %x7F.
     154// Returns an array of control characters along with their ASCII codes. Control
     155// characters are defined by RFC 5234 to be %x00-1F / %x7F.
    158156function getCtlCharacters() {
    159   const termCtlCodes = [0x00 /* NUL */, 0x0A /* LF */, 0x0D /* CR */];
    160157  const ctlCodes = [...Array(0x20).keys()]
    161                        .filter(i => termCtlCodes.indexOf(i) === -1)
    162158                       .concat([0x7F]);
    163   return {
    164     TERMINATING_CTLS:
    165         termCtlCodes.map(i => ({code: i, chr: String.fromCharCode(i)})),
    166     CTLS: ctlCodes.map(i => ({code: i, chr: String.fromCharCode(i)}))
    167   };
     159  return ctlCodes.map(i => ({ code: i, chr: String.fromCharCode(i) }))
    168160}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl-expected.txt

    r279585 r293691  
    11
    2 PASS Cookie with %x0 in value is truncated.
    3 PASS Cookie with %xa in value is truncated.
    4 PASS Cookie with %xd in value is truncated.
     2FAIL Cookie with %x0 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=0"
    53FAIL Cookie with %x1 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=1"
    64FAIL Cookie with %x2 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=2"
     
    119FAIL Cookie with %x7 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=7"
    1210FAIL Cookie with %x8 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=8"
    13 FAIL Cookie with %x9 in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=9\tvalue"
     11PASS Cookie with %x9 in value is accepted.
     12FAIL Cookie with %xa in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=10"
    1413FAIL Cookie with %xb in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=11"
    1514FAIL Cookie with %xc in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=12"
     15FAIL Cookie with %xd in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=13"
    1616FAIL Cookie with %xe in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=14"
    1717FAIL Cookie with %xf in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=15"
     
    3333FAIL Cookie with %x1f in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=31"
    3434FAIL Cookie with %x7f in value is rejected. assert_equals: The cookie was rejected. expected "" but got "test=127"
    35 PASS Cookie with %x1 after %x0 in value is truncated.
    36 PASS Cookie with %x2 after %x0 in value is truncated.
    37 PASS Cookie with %x3 after %x0 in value is truncated.
    38 PASS Cookie with %x4 after %x0 in value is truncated.
    39 PASS Cookie with %x5 after %x0 in value is truncated.
    40 PASS Cookie with %x6 after %x0 in value is truncated.
    41 PASS Cookie with %x7 after %x0 in value is truncated.
    42 PASS Cookie with %x8 after %x0 in value is truncated.
    43 PASS Cookie with %x9 after %x0 in value is truncated.
    44 PASS Cookie with %xb after %x0 in value is truncated.
    45 PASS Cookie with %xc after %x0 in value is truncated.
    46 PASS Cookie with %xe after %x0 in value is truncated.
    47 PASS Cookie with %xf after %x0 in value is truncated.
    48 PASS Cookie with %x10 after %x0 in value is truncated.
    49 PASS Cookie with %x11 after %x0 in value is truncated.
    50 PASS Cookie with %x12 after %x0 in value is truncated.
    51 PASS Cookie with %x13 after %x0 in value is truncated.
    52 PASS Cookie with %x14 after %x0 in value is truncated.
    53 PASS Cookie with %x15 after %x0 in value is truncated.
    54 PASS Cookie with %x16 after %x0 in value is truncated.
    55 PASS Cookie with %x17 after %x0 in value is truncated.
    56 PASS Cookie with %x18 after %x0 in value is truncated.
    57 PASS Cookie with %x19 after %x0 in value is truncated.
    58 PASS Cookie with %x1a after %x0 in value is truncated.
    59 PASS Cookie with %x1b after %x0 in value is truncated.
    60 PASS Cookie with %x1c after %x0 in value is truncated.
    61 PASS Cookie with %x1d after %x0 in value is truncated.
    62 PASS Cookie with %x1e after %x0 in value is truncated.
    63 PASS Cookie with %x1f after %x0 in value is truncated.
    64 PASS Cookie with %x7f after %x0 in value is truncated.
    65 PASS Cookie with %x1 after %xa in value is truncated.
    66 PASS Cookie with %x2 after %xa in value is truncated.
    67 PASS Cookie with %x3 after %xa in value is truncated.
    68 PASS Cookie with %x4 after %xa in value is truncated.
    69 PASS Cookie with %x5 after %xa in value is truncated.
    70 PASS Cookie with %x6 after %xa in value is truncated.
    71 PASS Cookie with %x7 after %xa in value is truncated.
    72 PASS Cookie with %x8 after %xa in value is truncated.
    73 PASS Cookie with %x9 after %xa in value is truncated.
    74 PASS Cookie with %xb after %xa in value is truncated.
    75 PASS Cookie with %xc after %xa in value is truncated.
    76 PASS Cookie with %xe after %xa in value is truncated.
    77 PASS Cookie with %xf after %xa in value is truncated.
    78 PASS Cookie with %x10 after %xa in value is truncated.
    79 PASS Cookie with %x11 after %xa in value is truncated.
    80 PASS Cookie with %x12 after %xa in value is truncated.
    81 PASS Cookie with %x13 after %xa in value is truncated.
    82 PASS Cookie with %x14 after %xa in value is truncated.
    83 PASS Cookie with %x15 after %xa in value is truncated.
    84 PASS Cookie with %x16 after %xa in value is truncated.
    85 PASS Cookie with %x17 after %xa in value is truncated.
    86 PASS Cookie with %x18 after %xa in value is truncated.
    87 PASS Cookie with %x19 after %xa in value is truncated.
    88 PASS Cookie with %x1a after %xa in value is truncated.
    89 PASS Cookie with %x1b after %xa in value is truncated.
    90 PASS Cookie with %x1c after %xa in value is truncated.
    91 PASS Cookie with %x1d after %xa in value is truncated.
    92 PASS Cookie with %x1e after %xa in value is truncated.
    93 PASS Cookie with %x1f after %xa in value is truncated.
    94 PASS Cookie with %x7f after %xa in value is truncated.
    95 PASS Cookie with %x1 after %xd in value is truncated.
    96 PASS Cookie with %x2 after %xd in value is truncated.
    97 PASS Cookie with %x3 after %xd in value is truncated.
    98 PASS Cookie with %x4 after %xd in value is truncated.
    99 PASS Cookie with %x5 after %xd in value is truncated.
    100 PASS Cookie with %x6 after %xd in value is truncated.
    101 PASS Cookie with %x7 after %xd in value is truncated.
    102 PASS Cookie with %x8 after %xd in value is truncated.
    103 PASS Cookie with %x9 after %xd in value is truncated.
    104 PASS Cookie with %xb after %xd in value is truncated.
    105 PASS Cookie with %xc after %xd in value is truncated.
    106 PASS Cookie with %xe after %xd in value is truncated.
    107 PASS Cookie with %xf after %xd in value is truncated.
    108 PASS Cookie with %x10 after %xd in value is truncated.
    109 PASS Cookie with %x11 after %xd in value is truncated.
    110 PASS Cookie with %x12 after %xd in value is truncated.
    111 PASS Cookie with %x13 after %xd in value is truncated.
    112 PASS Cookie with %x14 after %xd in value is truncated.
    113 PASS Cookie with %x15 after %xd in value is truncated.
    114 PASS Cookie with %x16 after %xd in value is truncated.
    115 PASS Cookie with %x17 after %xd in value is truncated.
    116 PASS Cookie with %x18 after %xd in value is truncated.
    117 PASS Cookie with %x19 after %xd in value is truncated.
    118 PASS Cookie with %x1a after %xd in value is truncated.
    119 PASS Cookie with %x1b after %xd in value is truncated.
    120 PASS Cookie with %x1c after %xd in value is truncated.
    121 PASS Cookie with %x1d after %xd in value is truncated.
    122 PASS Cookie with %x1e after %xd in value is truncated.
    123 PASS Cookie with %x1f after %xd in value is truncated.
    124 PASS Cookie with %x7f after %xd in value is truncated.
    12535
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cookies/value/value-ctl.html

    r279585 r293691  
    88    <script src="/resources/testharness.js"></script>
    99    <script src="/resources/testharnessreport.js"></script>
     10    <script src="/resources/testdriver.js"></script>
     11    <script src="/resources/testdriver-vendor.js"></script>
    1012    <script src="/cookies/resources/cookie-test.js"></script>
    1113  </head>
     
    1517      // Tests for control characters (CTLs) in a cookie's value.
    1618      // CTLs are defined by RFC 5234 to be %x00-1F / %x7F.
    17       const {TERMINATING_CTLS, CTLS} = getCtlCharacters();
     19      const CTLS = getCtlCharacters();
    1820
    19       // Start with a clean slate.
    20       dropAllDomCookies();
    21 
    22       // Test that terminating CTLs truncate the cookie string.
    23       for (const ctl of TERMINATING_CTLS) {
    24         domCookieTest(
     21      // All CTLs, with the exception of %x09 (the tab character), should
     22      // cause the cookie to be rejected.
     23      for (const ctl of CTLS) {
     24        if (ctl.code === 0x09) {
     25          domCookieTest(
    2526            `test=${ctl.code}${ctl.chr}value`,
    26             `test=${ctl.code}`,
    27             `Cookie with %x${ctl.code.toString(16)} in value is truncated.`);
    28       }
    29 
    30       // Test that other CTLs result in cookie rejection.
    31       for (const ctl of CTLS) {
    32         domCookieTest(
     27            `test=${ctl.code}${ctl.chr}value`,
     28            `Cookie with %x${ctl.code.toString(16)} in value is accepted.`);
     29        } else {
     30          domCookieTest(
    3331            `test=${ctl.code}${ctl.chr}value`,
    3432            '',
    3533            `Cookie with %x${ctl.code.toString(16)} in value is rejected.`);
    36       }
    37 
    38       // Test that truncation due to terminating CTLs occurs first.
    39       for (const termCtl of TERMINATING_CTLS) {
    40         for (const ctl of CTLS) {
    41           domCookieTest(
    42               `test=${ctl.code}term${termCtl.chr}va${ctl.chr}lue`,
    43               `test=${ctl.code}term`,
    44               `Cookie with %x${ctl.code.toString(16)} after ` +
    45                   `%x${termCtl.code.toString(16)} in value is truncated.`);
    4634        }
    4735      }
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie-expected.txt

    r267646 r293691  
    33PASS document.cookie
    44PASS document.cookie 1
    5 PASS document.cookie 2
     5FAIL document.cookie 2 assert_equals: expected "" but got "b=A"
    66PASS getting cookie for a cookie-averse document returns empty string, setting does nothing
    77
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/documents/resource-metadata-management/document-cookie.html

    r263903 r293691  
    1212  {value: "", expected: "", test: "Empty value"},
    1313  {value: "a=b", expected: "a=b", test: "A simple cookie"},
    14   {value: "b=A\0Z", expected: "b=A", test: "A null char"},
     14  {value: "b=A\0Z", expected: "", test: "A null char"},
    1515];
    1616
Note: See TracChangeset for help on using the changeset viewer.