diff --git a/cookie-store/cookieStore_set_arguments.tentative.https.any.js b/cookie-store/cookieStore_set_arguments.tentative.https.any.js index 6685f5fd3b7186..5668b858be0e2d 100644 --- a/cookie-store/cookieStore_set_arguments.tentative.https.any.js +++ b/cookie-store/cookieStore_set_arguments.tentative.https.any.js @@ -156,6 +156,19 @@ promise_test(async testCase => { assert_equals(cookie, null); }, 'cookieStore.set with name and value in options and expires in the past'); +promise_test(async testCase => { + const currentUrl = new URL(self.location.href); + const currentDomain = currentUrl.hostname; + + await promise_rejects_js(testCase, TypeError, cookieStore.set( + 'cookie-name', 'cookie-value', { domain: `.${currentDomain}` })); +}, 'cookieStore.set domain starts with "."'); + +promise_test(async testCase => { + await promise_rejects_js(testCase, TypeError, cookieStore.set( + 'cookie-name', 'cookie-value', { domain: 'example.com' })); +}, 'cookieStore.set with domain that is not equal current host'); + promise_test(async testCase => { const currentUrl = new URL(self.location.href); const currentDomain = currentUrl.hostname;