Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /cookie-store/cookieStore_getAll_set_basic.https.any.html - WPT Dashboard Interop Dashboard
- /cookie-store/cookieStore_getAll_set_basic.https.any.serviceworker.html - WPT Dashboard Interop Dashboard
// META: title=Cookie Store API: Interaction between cookieStore.set() and cookieStore.getAll()
// META: global=window,serviceworker
'use strict';
promise_test(async testCase => {
await cookieStore.set('cookie-name', 'cookie-value');
testCase.add_cleanup(async () => {
await cookieStore.delete('cookie-name');
});
const cookies = await cookieStore.getAll('cookie-name');
assert_equals(cookies.length, 1);
assert_equals(cookies[0].name, 'cookie-name');
assert_equals(cookies[0].value, 'cookie-value');
}, 'cookieStore.getAll returns the cookie written by cookieStore.set');