Closed
Bug 749258
Opened 13 years ago
Closed 13 years ago
toolkit/devtools/debugger xpcshell tests that throw errors do not fail
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 15
People
(Reporter: jimb, Unassigned)
References
Details
Attachments
(2 files)
(deleted),
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
dcamp
:
review+
|
Details | Diff | Splinter Review |
If a toolkit/devtools/debugger/tests xpcshell test causes dbg-server or dbg-client code to throw an error, the test still passes. This is because:
1) both client and server contain 'catch' clauses which report the error via Cu.reportError; and
2) we never register a console listener.
We should register a console listener, and if it gets an nsIScriptError, we should throw.
Attachment #618709 -
Flags: review?(dcamp)
Reporter | ||
Comment 1•13 years ago
|
||
Reporter | ||
Comment 2•13 years ago
|
||
(The patch also includes a bunch of minor changes like changing throw 'foo' to throw Error('foo') so we'll get backtraces, and printing stacks so Emacs can pick up the filenames and line numbers.)
Comment 3•13 years ago
|
||
Comment on attachment 618709 [details] [diff] [review]
Have toolkit/devtools/debugger xpcshell tests register a listener for Components.utils.reportError, so tests fail when they throw an exception.
Review of attachment 618709 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/devtools/debugger/server/dbg-server.js
@@ +63,5 @@
> }
> }
>
> +/* Turn the error e into a string, without fail. */
> +function safeErrorString(e) {
We use aError or somesuch in browser code.
::: toolkit/devtools/debugger/tests/unit/head_dbg.js
@@ +16,5 @@
> Cu.import("resource:///modules/devtools/dbg-server.jsm");
> Cu.import("resource:///modules/devtools/dbg-client.jsm");
>
> +// Convert an nsIScriptError 'flags' value into an appropriate string.
> +function scriptErrorFlagsToKind(flags) {
aFlags
Attachment #618709 -
Flags: review?(dcamp) → review+
Comment 4•13 years ago
|
||
We should land both of these at the same time.
Attachment #618744 -
Flags: review?(dcamp)
Updated•13 years ago
|
Attachment #618744 -
Flags: review?(dcamp) → review+
Reporter | ||
Comment 7•13 years ago
|
||
Status: NEW → ASSIGNED
Flags: in-testsuite-
Comment 8•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
Comment 9•13 years ago
|
||
Backed out the latest fx-team merge whole-sale because of Ts regressions:
https://hg.mozilla.org/mozilla-central/rev/b0200dab0ccc
Please reland only after investigating and fixing the regression. Thanks!
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 10•13 years ago
|
||
I messed up and backed out the wrong range, sorry about that. I backed out my backout, so this is still on mozilla-central:
https://hg.mozilla.org/mozilla-central/rev/dec5b367c421
Updated•13 years ago
|
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•