Bug 1456996 - [wdclient] Add http-only support for setting a cookie. r=maja_zf
authorHenrik Skupin <mail@hskupin.info>
Wed, 25 Apr 2018 23:34:25 +0200
changeset 415906 1f4ce46796fc2e003c0fa58391f39f3fdf35a944
parent 415905 d1b7f7e210c6663614c8fd03494929ab90c833e8
child 415907 9833513330b4f3468b50ffd9f9ee77a9e5f25449
push id33911
push usercsabou@mozilla.com
push dateFri, 27 Apr 2018 10:01:39 +0000
treeherdermozilla-central@822936017145 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1456996
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456996 - [wdclient] Add http-only support for setting a cookie. r=maja_zf MozReview-Commit-ID: ZkiNOXK9Wg
testing/web-platform/tests/tools/webdriver/webdriver/client.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/client.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/client.py
@@ -557,27 +557,33 @@ class Session(object):
     def cookies(self, name=None):
         if name is None:
             url = "cookie"
         else:
             url = "cookie/%s" % name
         return self.send_session_command("GET", url, {})
 
     @command
-    def set_cookie(self, name, value, path=None, domain=None, secure=None, expiry=None):
-        body = {"name": name,
-                "value": value}
+    def set_cookie(self, name, value, path=None, domain=None,
+            secure=None, expiry=None, http_only=None):
+        body = {
+            "name": name,
+            "value": value,
+        }
+
+        if domain is not None:
+            body["domain"] = domain
+        if expiry is not None:
+            body["expiry"] = expiry
+        if http_only is not None:
+            body["httpOnly"] = http_only
         if path is not None:
             body["path"] = path
-        if domain is not None:
-            body["domain"] = domain
         if secure is not None:
             body["secure"] = secure
-        if expiry is not None:
-            body["expiry"] = expiry
         self.send_session_command("POST", "cookie", {"cookie": body})
 
     def delete_cookie(self, name=None):
         if name is None:
             url = "cookie"
         else:
             url = "cookie/%s" % name
         self.send_session_command("DELETE", url, {})