In some places we pass variables by value unnecessarily. In these
cases it would be more memory efficient to pass a reference so that
we avoid copying.
Instead of using a catch-all that ignores the error cause, we can
print the cause as part of the panic.
Eventually the error handling in this function should be fixed to
not panic at all, obviously.
The command "Take Element Screenshot" expects the web element as
parameter, and not as part of the body.
--HG--
extra : rebase_source : 6ca78d005cae65273d0d6045ac60e80e993b55bd
Whilst it is logically correct to use 408 for the
ErrorStatus::ScriptTimeout and ::Timeout errors, it
causes a collision with HTTP semantics implement in HTTP clients.
To support Keep-Alive we allow retries in HTTP clients and if a
client sees code 408 it thinks that the server has gone away and
retries the request.
This causes WebDriverCommand::ExecuteScript, ::Get, and ::Refresh
commands to be sent twice with some HTTP clients.
This is a backwards incompatible change to WebDriver in order to
not break HTTP/1.1 Keep-Alive.
The patch switches the serialization and deserialization of data
structures from the rustc_serialize crate to serde. By doing that
all the custom code for serialization and deserialization can be
removed in favor of serde's automatically derived serializers and
deserializers.
MozReview-Commit-ID: F25p325gbiC
--HG--
extra : rebase_source : 362300476b0ce670cc457320c76db3929d673b65
Instead use serde. This is the simplest possible conversion using the
serde Value type everywhere. The intent is to use the automatically
derived deserializers in the future.
MozReview-Commit-ID: F25p325gbiC
--HG--
extra : rebase_source : 661316cf0f1b1f395b3c7166890f13477036f877
Increasing geckodriver's Keep-Alive timeout duration to 90
seconds, from the default five seconds, will reduce the number of
HTTP connections a persistent-enabled client will have to make,
potentially boosting performance.
In more recent hyper versions the default is 90 seconds, which
means we can get rid of this line when hyper is upgraded.
This will help mitigate https://github.com/mozilla/geckodriver/issues/1304
but not fundamentally resolve it, due to a standard library bug in
Python 2.7's urllib.
MozReview-Commit-ID: 98AFDQgWfpw
--HG--
extra : rebase_source : 75ce5a143533134b60848f2351aab60778c53d78
This makes geckodriver support WebDriver web elements, web frames,
and web windows.
Marionette sends back JSON Objects such as
{<element key>: <uuid>}
where the element key is one of the unique strings this patch adds
to geckodriver::marionette.
MozReview-Commit-ID: HegkGFqxkms
--HG--
extra : rebase_source : 88d51ac29b429124e2e321c0cccda949397fd307
geckodriver currently only supports "accept" and "dismiss".
But to be compliant with the WebDriver specification all
allowed options have to be supported.
Given that Marionette uses the hard-coded dismiss and notify
behavior for unexpected prompts, inappropriately marked as
failed tests for accept/dismiss + notify for
execute_(async_)script will pass now.
MozReview-Commit-ID: 14kRTpvJYjZ
--HG--
extra : rebase_source : 71054e6ff066b9a2c0541e223cdf25136fc4ff85
WebDriver commands which do not return a value have to send null.
But currently geckodriver returns an empty object.
MozReview-Commit-ID: EEmNlbmxu5n
--HG--
extra : rebase_source : aaa09cb5d8470b9669b8046ead62d709111f7f04
Also bump webdriver's version so it can be released and updated in servo
MozReview-Commit-ID: 7jMycZ6t3mm
--HG--
extra : rebase_source : 44d0b436e303d427a8b4c06e5b97538a76fd3f8c
This patch somewhat marginally improves error messages returned
during capabilities negotiation.
MozReview-Commit-ID: IHTRk7Rl4ZU
--HG--
extra : rebase_source : a669039092d79ec2fb3b66f7e9ef6c3ed21bfd44
This patch somewhat marginally improves error messages returned
during capabilities negotiation.
MozReview-Commit-ID: IHTRk7Rl4ZU
--HG--
extra : rebase_source : 0fdca046ad69f732d70d5a23145578697cc2fb61
With the request to shutdown the browser, a given amount of time
has to be waited to allow the process to shutdown itself. Only
if the process is still running afterward it has to be killed.
Firefox has an integrated background monitor which observes
long running threads during shutdown, and kills those after
65s. To allow Firefox to shutdown on its own, geckodriver
has to wait that time, and some additional seconds.
MozReview-Commit-ID: 4LRLQE0jZzw
--HG--
extra : rebase_source : c33c163d4d06768ea6616b97a25f986f5ea37e5d
With the request to shutdown the browser, a given amount of time
has to be waited to allow the process to shutdown itself. Only
if the process is still running afterward it has to be killed.
Firefox has an integrated background monitor which observes
long running threads during shutdown, and kills those after
120s. To allow Firefox to shutdown on its own, geckodriver
has to wait that time, and some additional seconds.
MozReview-Commit-ID: 4LRLQE0jZzw
--HG--
extra : rebase_source : 62422c609131dfe23e547967bcfc5dfb34f30172
The HTTP status for the "stale element reference" error in WebDriver
should be 404 (Not Found).
MozReview-Commit-ID: CBb7Ds8AEY3
--HG--
extra : rebase_source : 9b4309d43118730e20cb4ba17312a49cc203c58b
Made this a separate commit from that which actually removes the
in-tree vendored dependencies to make it easier to review.
MozReview-Commit-ID: 9xbkM0EfOOL
--HG--
extra : rebase_source : 6686dc07a25df1a820914eb715fb733778f092cb
The Rust backtrace from geckodriver is not useful since any error
we actually return is by-definition handled by the code, and we
can probably get more information just by looking at the error type
and string.
At the same time, it runs the risk of confusing users into thinking
there was a bug in the driver when actually it's perfectly normal
handling of invalid input.
MozReview-Commit-ID: 9S5IaioA5AA
--HG--
extra : rebase_source : 0d98188c263d51402c2330a6b730752487dcc7fc
A release of the webdriver crate is necessary for the release build
to pass on Travis, since testing/geckodriver/Cargo.toml cannot
depend on testing/webdriver as it is exported to the GitHub repository.
MozReview-Commit-ID: 1S2aAtg50t4
--HG--
extra : rebase_source : 53ef155537a44ef2bc141ea30a635e4144625118
This allows us to construct an ErrorStatus variant from a String.
This is useful if the remote end implementation uses the string
codes for transport.
The new From<String> trait for ErrorStatus is a reverse lookup of
ErrorStatus::error_code.
It currently handles two cases of Selenium errors, which are "element
not visible" and "invalid element coordinates". Both these have
been deprecated in the WebDriver standard and we need to figure
out a deprecation strategy for them.
MozReview-Commit-ID: 48MAVNQoiKy
--HG--
extra : rebase_source : 80c0932e3d42cfe19faa673d558790c83762dba1
References to mutable variables do not need mutable themselves.
This fixes a series of mutable variable warnings emitted by the
Rust compiler.
MozReview-Commit-ID: EosL5XNRRX4
--HG--
extra : rebase_source : 62aa86b2c6c87a5f39ee228dcad6b5e4162779d8
No functional changes here, but the indentation was wrong in many
places, making it very hard to read the code.
MozReview-Commit-ID: Iku7yPD30QV
--HG--
extra : rebase_source : 31aa77135ca7f89eab60335b5bb968c4d6f1294a
s/was/is/ in various error messages for harmony.
MozReview-Commit-ID: IrRw4Vl8bIK
--HG--
extra : rebase_source : 2e4a26077733fc4a182dca0feedd14291675d6ad