Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Tolfsen
3e5326f9db Bug 1362992 - Wrap implementation errors as UnknownError r=automatedtester
JavaScript errors that arise from the Marionette implementation are
currently wrapped as WebDriverErrors.  A WebDriverError is encoded with
a "webdriver error" error code, which officially does not exist in the
WebDriver specification.

To distinguish WebDriver errors from programming errors of Marionette,
this changes them to be encoded as UnknownErrors (error code
"unknown error").  This will make stacktraces coming from clients
easier to read, since it is clear that the error is not caught by the
WebDriverError-catchall.

MozReview-Commit-ID: A5HejTOgOp8

--HG--
extra : rebase_source : 7bd4f539954dd11973b2bd16c1bf4f4ea7b4a4d7
2017-05-08 14:01:30 +01:00
Andreas Tolfsen
24fba2b89e Bug 1337743 - More data validation checks for Marionette messages; r=whimboo
This change introduces more data validation checks on unmarshaling
Marionette protocol messages.  Specifically, validation of
message.Command's and message.Response's constructor arguments and packet
contents in their respective fromMsg functions are tested.

Doing these tests ensures more safety further down the pipeline with
respect to the data integrity in Marionette commands.

MozReview-Commit-ID: BxYipX5zfo9

--HG--
extra : rebase_source : 5cd9edab8801323b19688f871ba78ccf70a05c5e
2017-02-09 18:22:09 +00:00
Andreas Tolfsen
69d406c698 Bug 1336214 - Preserve stacktraces in Marionette errors; r=maja_zf
Since bug 1326534 we have discarded the original stacktrace from errors
originating inside Marionette.  This was due to faulty logic when
attempting to generate a new stacktrace when it was missing from a
propagated error.

This change simplifies WebDriver errors by making use of Error
inheritance.  The WebDriver error specific functions error.toJson and
error.fromJson has additionally been moved to WebDriverError.

MozReview-Commit-ID: C3Ns0H01LyG

--HG--
extra : rebase_source : 0c705054dae8c0647500bb90e9b970cc57e712c4
2017-02-10 18:36:52 +00:00
Andreas Tolfsen
a35ff231b0 Bug 1326534 - Preserve stacks when passing error protos to WebDriverError; r=automatedtester
The `stack` argument to `WebDriverError` has never been in use.  Following
the API of the `Error` prototype, this changes its constructor to take
one argument which can either be a string of an `Error`.

When internal errors are thrown in Marionette, they are usually
wrapped in `WebDriverError` but we currently lose track of its stack.
This preserves the wrapped error's stacktrace by setting the `stack`
property.  Practice have found that they are very useful to return to
the client, as they are currently only printed to stdout.

MozReview-Commit-ID: 9sTdP4TntIc

--HG--
extra : rebase_source : f14197a1c8700215ce3d0edc7078c9f568b80ec4
2016-12-30 11:26:30 +00:00
Andreas Tolfsen
c5255475ef Bug 1253677 - Remove run_test functions from xpcshell tests; r=automatedtester
These functions do nothing.

MozReview-Commit-ID: 6AiXA8zEbv2

--HG--
extra : rebase_source : a01266752baba31712eb05b80cd8431326dbce9e
2016-03-04 18:25:21 +00:00
Andreas Tolfsen
578011d7a7 Bug 1239373 - Tests for testing/marionette/message.js; r=automatedtester
--HG--
extra : rebase_source : 0c1907b6558e079fd4b666e461b55ba2d6d3ed72
extra : source : cb00c71c2123fa2ee48694f4cf276ea8c3902e9c
2016-01-18 18:39:21 +00:00
Nigel Babu
e806014c5e Backed out 3 changesets (bug 1239373) for xpcshell bustage on emulator
Backed out changeset 308b5e2bb5df (bug 1239373)
Backed out changeset 783077fc10a2 (bug 1239373)
Backed out changeset 32e6e21daeda (bug 1239373)

--HG--
extra : commitid : FRAHnToBmu7
2016-01-19 13:16:37 +05:30
Andreas Tolfsen
32c9e1797b Bug 1239373 - Tests for testing/marionette/message.js; r=automatedtester
--HG--
extra : rebase_source : deb18863725dcafd002061713467ff188f1d1aeb
2016-01-18 18:39:21 +00:00