Skip to content

Commit 98dac8a

Browse files
yezhizhenservo-wpt-sync
authored andcommitted
Add Cookie: Add test where cookie domain inconsistent with current document domain
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
1 parent 9d3444e commit 98dac8a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

webdriver/tests/classic/add_cookie/add.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,19 @@ def test_add_cookie_with_invalid_expiry(session, url, expiry):
319319

320320
response = add_cookie(session, new_cookie)
321321
assert_error(response, "invalid argument")
322+
323+
324+
def test_add_cookie_with_domain_not_matching_current_domain(session, url):
325+
session.url = url("/common/blank.html")
326+
327+
new_cookie = {
328+
"name": "hello",
329+
"value": "world",
330+
"domain": "example.com",
331+
"path": "/",
332+
"httpOnly": False,
333+
"secure": False
334+
}
335+
336+
response = add_cookie(session, new_cookie)
337+
assert_error(response, "invalid argument")

0 commit comments

Comments
 (0)