WebDriver: implement cookies commands
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Aug 2017 11:52:55 +0000 (11:52 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Aug 2017 11:52:55 +0000 (11:52 +0000)
commit1d71ccafcb40f515031a8054d6378c228b594bbd
treedc9622a1e6ac6c8b2b2227a18b1d238690cfa993
parent7e542279143300c2d4e9ac4b10c340141ff16322
WebDriver: implement cookies commands
https://bugs.webkit.org/show_bug.cgi?id=174613

Reviewed by Brian Burg.

Add cookies commands.

16. Cookies.
https://w3c.github.io/webdriver/webdriver-spec.html#cookies

* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const): Add NoSuchCookie error.
(WebDriver::CommandResult::errorString const): Ditto.
* CommandResult.h:
* Session.cpp:
(WebDriver::parseAutomationCookie): Parse JSON cookie object returned by automation and convert it to a Cookie struct.
(WebDriver::builtAutomationCookie): Build a JSON cookie object as expected by automation from a Cookie struct.
(WebDriver::serializeCookie): Serialize a Cookie struct into a JSON cookie object according to the WebDriver spec.
(WebDriver::Session::getAllCookies):
(WebDriver::Session::getNamedCookie):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::getAllCookies):
(WebDriver::WebDriverService::getNamedCookie):
(WebDriver::deserializeCookie):
(WebDriver::WebDriverService::addCookie):
(WebDriver::WebDriverService::deleteCookie):
(WebDriver::WebDriverService::deleteAllCookies):
* WebDriverService.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebDriver/ChangeLog
Source/WebDriver/CommandResult.cpp
Source/WebDriver/CommandResult.h
Source/WebDriver/Session.cpp
Source/WebDriver/Session.h
Source/WebDriver/WebDriverService.cpp
Source/WebDriver/WebDriverService.h