mirror of
https://github.com/servo/servo.git
synced 2025-08-16 19:05:33 +01:00
Update web-platform-tests to revision ea14651f262003177d0ba5819bd2806a1327b12a
This commit is contained in:
parent
847115ba04
commit
816185f094
272 changed files with 5766 additions and 2855 deletions
|
@ -0,0 +1,47 @@
|
|||
// META: script=resources/cookie-test-helpers.js
|
||||
|
||||
'use strict';
|
||||
|
||||
cookie_test(async t => {
|
||||
let eventPromise = observeNextCookieChangeEvent();
|
||||
await setCookieStringHttp('HTTPONLY-cookie=value; path=/; httponly');
|
||||
assert_equals(
|
||||
await getCookieString(),
|
||||
undefined,
|
||||
'HttpOnly cookie we wrote using HTTP in cookie jar' +
|
||||
' is invisible to script');
|
||||
assert_equals(
|
||||
await getCookieStringHttp(),
|
||||
'HTTPONLY-cookie=value',
|
||||
'HttpOnly cookie we wrote using HTTP in HTTP cookie jar');
|
||||
|
||||
await setCookieStringHttp('HTTPONLY-cookie=new-value; path=/; httponly');
|
||||
assert_equals(
|
||||
await getCookieString(),
|
||||
undefined,
|
||||
'HttpOnly cookie we overwrote using HTTP in cookie jar' +
|
||||
' is invisible to script');
|
||||
assert_equals(
|
||||
await getCookieStringHttp(),
|
||||
'HTTPONLY-cookie=new-value',
|
||||
'HttpOnly cookie we overwrote using HTTP in HTTP cookie jar');
|
||||
|
||||
eventPromise = observeNextCookieChangeEvent();
|
||||
await setCookieStringHttp(
|
||||
'HTTPONLY-cookie=DELETED; path=/; max-age=0; httponly');
|
||||
assert_equals(
|
||||
await getCookieString(),
|
||||
undefined,
|
||||
'Empty cookie jar after HTTP cookie-clearing using max-age=0');
|
||||
assert_equals(
|
||||
await getCookieStringHttp(),
|
||||
undefined,
|
||||
'Empty HTTP cookie jar after HTTP cookie-clearing using max-age=0');
|
||||
|
||||
// HTTPONLY cookie changes should not have been observed; perform
|
||||
// a dummy change to verify that nothing else was queued up.
|
||||
await cookieStore.set('TEST', 'dummy');
|
||||
await verifyCookieChangeEvent(
|
||||
eventPromise, {changed: [{name: 'TEST', value: 'dummy'}]},
|
||||
'HttpOnly cookie deletion was not observed');
|
||||
}, 'HttpOnly cookies are not observed');
|
Loading…
Add table
Add a link
Reference in a new issue