Closed
Bug 1240675
Opened 9 years ago
Closed 9 years ago
Add tests for Bug 1208641
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
mozilla47
People
(Reporter: wcpan, Unassigned)
Details
Attachments
(1 file)
3.29 KB,
patch
|
vporof
:
review+
|
Details | Diff | Splinter Review |
Add a test to ensure bug 1208641 do not fail.
Reporter | ||
Comment 1•9 years ago
|
||
An uncaught exception will cause the test fail, but unfortunately it's what I need to test.
Maybe we need something like "except_exception = MyException" in mochitest.
Comment 2•9 years ago
|
||
I could help writing devtools test against that. Also I already wrote more low level test in xpconnect.
We already assert for valid stacks for common web exception.
In what precise scenarios should we see new stack appear on exceptions?
If I follow correctly, last patch from bug 1208641 is going to focus on window-related exceptions,
so it won't show JSM stacks yet?
Reporter | ||
Comment 3•9 years ago
|
||
(In reply to Alexandre Poirot [:ochameau] from comment #2)
> I could help writing devtools test against that. Also I already wrote more
> low level test in xpconnect.
> We already assert for valid stacks for common web exception.
> In what precise scenarios should we see new stack appear on exceptions?
>
> If I follow correctly, last patch from bug 1208641 is going to focus on
> window-related exceptions,
> so it won't show JSM stacks yet?
Yes, if a JSM throws an exception which created by Components.Exception, then the stack won't show in console.
I've tried to throw exception in the mochitest, but I can't seem to reproduce the problem.
Here is how I reproduce bug 1208641 on B2G:
1. modify some frequently used js module, e.g. BrowserElementParent.js
2. throw Components.Exception in every method
3. use adb logcat to observe B2G logs, some exceptions won't print the stack
![]() |
||
Comment 4•9 years ago
|
||
> An uncaught exception will cause the test fail, but unfortunately it's what I need to test.
SimpleTest.expectUncaughtException() will solve this problem for you. But from inside a mochitest it may not be trivial to tell what the console sees, so a devtools test is likely better.
> In what precise scenarios should we see new stack appear on exceptions?
<script>
function f() {
throw new DOMException("Hello");
}
f();
</script>
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Here is a patch varifying that stacks now appear on following code:
document.querySelector("broken;selector");
throw new DOMException("plop"); // <= may be this one is redundant?
Attachment #8721980 -
Flags: review?(vporof)
Updated•9 years ago
|
Attachment #8721980 -
Flags: review?(vporof) → review+
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/138f7c7856b618dfd3f3faafcec9d3e164e188ec
Bug 1240675 - Verify that webconsole prints stacks for DOM Exceptions. r=vporof
Comment 8•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•