-
- Downloads
Bug 1411281 - Unmarshal all responses in WPT WebDriver client r=jgraham
The WPT WebDriver client currently only unmarshals responses for some commands (notably execute_script, execute_async_script, and find.css). For the client API we want to unmarshal all response bodies automatically. This patch moves all JSON serialisation/deserialisation to a new webdriver.protocol package so that it is not scattered around the client API. It introduces specialisations of JSONEncoder and JSONDecoder that allows web element references to be recognised and converted to complex webdriver.Element objects. This change means it is no longer necessary for callers to invoke webdriver.Session._element to convert the response to a web element as this will be done automatically on any request- and response body to webdriver.Sesson.send_command. An important thing to note is that HTTPWireProtocol.send does not follow this behaviour by default. That is because session.transport.send is used throughout WebDriver tests in WPT as a way to get the raw JSON body without having to set up session state manually. MozReview-Commit-ID: 5UyDAe43Hgf --HG-- extra : rebase_source : b86495dd0dcd102e6dea87011caafad475b88723
Showing
- testing/web-platform/tests/tools/webdriver/webdriver/client.py 22 additions, 36 deletions...ng/web-platform/tests/tools/webdriver/webdriver/client.py
- testing/web-platform/tests/tools/webdriver/webdriver/protocol.py 35 additions, 0 deletions.../web-platform/tests/tools/webdriver/webdriver/protocol.py
- testing/web-platform/tests/tools/webdriver/webdriver/transport.py 80 additions, 42 deletions...web-platform/tests/tools/webdriver/webdriver/transport.py
Loading
Please register or sign in to comment