Commit Graph
26 Commits
Author SHA1 Message Date
Andreas Tolfsen 04ed39a3ed Bug 1394849 - Add error.stack to create stacktraces. r=automatedtester
This patch introduces a new error.stack function as a shorthand for
creating stacktraces.  It is equivalent to calling

	new Error().stack

and removing the first line of the stack.  Removing the first line is
needed to make it appear as if the error originated from the caller's
position in the program.

MozReview-Commit-ID: DpSSWU5vPDm
2017-08-29 17:34:37 +01:00
Andreas Tolfsen 7aeed18293 Bug 1394849 - Export pprint separately. r=automatedtester
pprint is currently exposed twice: once on the error namespace and once
separately.  We only want to expose it once, and since there are only a
handful "error.pprint" usages left, we can go ahead and make this change.

When we move transition to use "require" in the future, like devtools
does, it will be possible to use both "error.pprint" and "pprint" styles
without export duplication.

MozReview-Commit-ID: CAnPDWn9Vr7
2017-08-29 17:33:38 +01:00
Andreas Tolfsen 521870d93c Bug 1376128 - Lint testing/marionette; r=automatedtester
MozReview-Commit-ID: DY4yCSBEZrN
2017-06-29 16:40:24 -07:00
Andreas Tolfsen 36b63af793 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
2017-05-08 14:01:30 +01:00
David Burns 0b8d4c38d0 Bug 1362990: Implement InvalidCookieDomainError in Marionette; r=ato
This implements the error Invalid Cookie Domain as described in
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-invalid-cookie-domain
which is used in the Marionette Cookie Handling code.

MozReview-Commit-ID: EA8Zb03QcMo
2017-05-08 17:08:41 +01:00
Andreas Tolfsen 7da810455a Bug 1359050 - Test element in view with pointer events enabled; r=maja_zf
This change makes it possible to click elements that has its
pointer-events style property set to "none".

If an element has its style property pointer-events set to "none",
the element in view test will fail due to document.elementsFromPoint
excluding it due to non-interactability.  This is only a problem when
checking if the element is inside the viewport, and not when actually
performing interaction with the element.

The relevant specification change is
https://github.com/w3c/webdriver/commit/ba6ee925b5bc85938d542d65ef5034a761fe73d7.

MozReview-Commit-ID: JwZB6fm7P9A
2017-04-17 19:34:44 +01:00
Andreas Tolfsen 9cd498a1ba Bug 1333014 - Pretty-print HTML elements; r=maja_zf
When passing a DOM element that is an HTML element to error.pprint,
it will get pretty-printed with its ID and class properties.

This helps to identify elements when one is obscuring the other when
clicking. For example, the error message

	Element <input id="foo"> is obscured by <input id="bar">

is nicer than the old error message

	Element [object HTMLElement] {} is obscured by [object HTMLElement] {}

MozReview-Commit-ID: 8U2Lo8V4lmv
2017-02-07 16:59:59 +00:00
Andreas Tolfsen b8655acc2a Bug 1333014 - Align element interaction errors with spec; r=whimboo
This renames the ElementNotVisibleError to ElementNotInteractableError,
and adds a new ElementClickInterceptedError.

MozReview-Commit-ID: 6cjVghUCvyv
2017-02-03 19:30:13 +00:00
Andreas Tolfsen aa93eaee12 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
2017-02-10 18:36:52 +00:00
Andreas Tolfsen 85604d2a9f Bug 1336214 - Remove duplicate error.wrap; r=maja_zf
MozReview-Commit-ID: KC6ByTiyhre
2017-02-09 19:28:30 +00:00
Andreas Tolfsen 8efd4b2474 Bug 1326534 - Propagate stacktraces for WebDriver errors; r=automatedtester
When we currently create new WebDriver errors we throw away the stacktrace
generated by `WebDriverError`'s prototype, `Error`.  This change stores
the stacktrace, which will cause it to be serialised and returned to
the client.

This change is not as valuable as storing the stacktraces of internal
errors, but brings symmetry to our error handling and may be useful if
only to navigate to the source of an error.

MozReview-Commit-ID: LCFMwKxxcTp
2016-12-30 13:07:54 +00:00
Andreas Tolfsen 52fc64c0f4 Bug 1284232 - Guard against ill-behaved objects on error check; r=automatedtester
It turns out that certain objects such as a DOMRectList have peculiarities
that cause string comparison to throw. This is normally not a problem
as error.isError is usually passed JSON serialisable data. But when it
is not, this try condition helps diagnose problems.

MozReview-Commit-ID: BLNSziwfxXs
2016-07-08 13:58:04 +01:00
Andreas Tolfsen 552e978ddf Bug 1275042 - Turn undefined error message- and stacktrace fields into strings; r=automatedtester
MozReview-Commit-ID: A2DYgTqp2rp
2016-05-23 17:46:04 +01:00
Andreas Tolfsen c9b0e74cfa Bug 1253677 - Remove run_test functions from xpcshell tests; r=automatedtester
These functions do nothing.

MozReview-Commit-ID: 6AiXA8zEbv2
2016-03-04 18:25:21 +00:00
Andreas Tolfsen 74200803e9 Bug 1245153 - Add error.wrap to wrap Error prototypes; r=automatedtester
Generally, Error prototypes that are not based on WebDriverError must
be wrapped so that they can be serialised across the AsyncMessageChannel.

MozReview-Commit-ID: EtkpEOBhrST
2016-02-03 18:43:37 +00:00
Andreas Tolfsen 4a939989aa Bug 1245153 - error.isError must recognise built-in Error prototypes; r=automatedtester
Due to a previous programming error, error.isError only recognised
the base Error prototype.  It must also test for the other built-in
prototypes, such as TypeError et al.

MozReview-Commit-ID: HLkiOAg0Jl1
2016-02-03 18:41:37 +00:00
Carsten "Tomcat" Book 8f534e440a Backed out 18 changesets (bug 1245153) for multiple test failures
Backed out changeset 18d54b8d4ae8 (bug 1245153)
Backed out changeset 98b6d0c053c0 (bug 1245153)
Backed out changeset c29a348930a4 (bug 1245153)
Backed out changeset f79252e92acc (bug 1245153)
Backed out changeset 9f3f1c358e47 (bug 1245153)
Backed out changeset 3b9e9a027fa7 (bug 1245153)
Backed out changeset 6da8099573f3 (bug 1245153)
Backed out changeset 63a56310a1b5 (bug 1245153)
Backed out changeset 5fe42d498a2a (bug 1245153)
Backed out changeset b3be2d2f3ac1 (bug 1245153)
Backed out changeset ad5bf32d8fef (bug 1245153)
Backed out changeset 68a6dda373d2 (bug 1245153)
Backed out changeset 6ebd9fde50c0 (bug 1245153)
Backed out changeset e41a5b41859a (bug 1245153)
Backed out changeset 048d70070751 (bug 1245153)
Backed out changeset eff85dc0eaa9 (bug 1245153)
Backed out changeset dc6460e0f336 (bug 1245153)
Backed out changeset 36526a2e8b00 (bug 1245153)
2016-02-11 17:05:41 +01:00
Andreas Tolfsen bcdc5bedd2 Bug 1245153 - Add error.wrap to wrap Error prototypes; r=automatedtester
Generally, Error prototypes that are not based on WebDriverError must
be wrapped so that they can be serialised across the AsyncMessageChannel.

MozReview-Commit-ID: EtkpEOBhrST
2016-02-03 18:43:37 +00:00
Andreas Tolfsen 4de2a4c5f5 Bug 1245153 - error.isError must recognise built-in Error prototypes; r=automatedtester
Due to a previous programming error, error.isError only recognised
the base Error prototype.  It must also test for the other built-in
prototypes, such as TypeError et al.

MozReview-Commit-ID: HLkiOAg0Jl1
2016-02-03 18:41:37 +00:00
Carsten "Tomcat" Book aea1b0ea44 Backed out 16 changesets (bug 1245153) for mochitest test-bustage on a CLOSED TREE
Backed out changeset 30c8ec933737 (bug 1245153)
Backed out changeset 4c2b1902d7cd (bug 1245153)
Backed out changeset 1be5f60393a0 (bug 1245153)
Backed out changeset 22321e6b65e9 (bug 1245153)
Backed out changeset c1e0abbfa66e (bug 1245153)
Backed out changeset 80ae953819c8 (bug 1245153)
Backed out changeset 3edb67388ad6 (bug 1245153)
Backed out changeset 55f64197f6b5 (bug 1245153)
Backed out changeset 6bb93562a576 (bug 1245153)
Backed out changeset 5da7628c3767 (bug 1245153)
Backed out changeset bd41e4ab829d (bug 1245153)
Backed out changeset ee7ee24cc65e (bug 1245153)
Backed out changeset 4b2a5ee7199e (bug 1245153)
Backed out changeset d75ad1397656 (bug 1245153)
Backed out changeset 1f5e37f8e446 (bug 1245153)
Backed out changeset aec0a0166685 (bug 1245153)
2016-02-05 14:18:19 +01:00
Andreas Tolfsen 97b86daf3c Bug 1245153 - Add error.wrap to wrap Error prototypes; r=automatedtester
Generally, Error prototypes that are not based on WebDriverError must
be wrapped so that they can be serialised across the AsyncMessageChannel.
2016-02-03 18:43:37 +00:00
Andreas Tolfsen 3c8cbe635c Bug 1245153 - error.isError must recognise built-in Error prototypes; r=automatedtester
Due to a previous programming error, error.isError only recognised
the base Error prototype.  It must also test for the other built-in
prototypes, such as TypeError et al.
2016-02-03 18:41:37 +00:00
Andreas Tolfsen 988324fb79 Bug 1243704 - Serialise errors sent over IPC; r=automatedtester
This fixes an instance of passing an Error prototype over the message
manager as a CPOW.  We solve this by marshaling the error, which is
now done automatically by the new AsyncMessageChannel.  It allows us to
create an (almost) transparent promise-based interface between chrome-
and content contexts.

The patch also makes AsyncMessageChannel reusable on both sides of the
message listener, but it's currently not used at its maximum potential
because of the way the listener is architected.
2016-01-29 12:57:46 +00:00
Andreas Tolfsen 4893d10be1 Bug 1239373 - Tests for testing/marionette/error.js; r=automatedtester 2016-01-18 18:38:47 +00:00
Nigel Babu fc0ade54cf 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)
2016-01-19 13:16:37 +05:30
Andreas Tolfsen a58f70a0db Bug 1239373 - Tests for testing/marionette/error.js; r=automatedtester 2016-01-18 18:38:47 +00:00