| <!DOCTYPE html> |
| <meta charset="utf-8"> |
| <!-- NOTE: On http://localhost, the Cookie Store API is intended to behave the |
| same way as document.cookie. --> |
| <title>Cookie Store API: Set a cookie on http://localhost</title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script> |
| |
| promise_test(async t => { |
| await promise_rejects_js(t, TypeError, |
| cookieStore.set({ |
| name: 'cookie-name', value: 'cookie-value' |
| })); |
| }, 'cookieStore.set(options) throws an exception'); |
| |
| promise_test(async t => { |
| await promise_rejects_js(t, TypeError, |
| cookieStore.set('cookie-name', 'cookie-value')); |
| }, `cookieStore.set(name, value) throws an exception`); |
| |
| </script> |