зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1630711
[wpt PR 23027] - CookieStore: Add domain validation wpt, a=testonly
Automatic update from web-platform-tests CookieStore: Add domain validation wpt This change adds tests for domain validation in wpt. Change-Id: Id8c74374d23bd72787ecc40919070b98684e163c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149699 Commit-Queue: Victor Costan <pwnall@chromium.org> Reviewed-by: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#760748} -- wpt-commits: 643c701b85063133e0f5c9f5168c7ebfd9fccb0c wpt-pr: 23027
This commit is contained in:
Родитель
2f54ff25d1
Коммит
df065caf44
|
@ -156,6 +156,19 @@ promise_test(async testCase => {
|
||||||
assert_equals(cookie, null);
|
assert_equals(cookie, null);
|
||||||
}, 'cookieStore.set with name and value in options and expires in the past');
|
}, '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 => {
|
promise_test(async testCase => {
|
||||||
const currentUrl = new URL(self.location.href);
|
const currentUrl = new URL(self.location.href);
|
||||||
const currentDomain = currentUrl.hostname;
|
const currentDomain = currentUrl.hostname;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче