Closed
Bug 966563
Opened 12 years ago
Closed 11 years ago
Add xpcshell tests for fixes in bug 966560
Categories
(Firefox :: Sync, defect)
Firefox
Sync
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: jedp, Assigned: jedp)
References
Details
(Whiteboard: [qa-])
What it says.
Assignee | ||
Comment 1•12 years ago
|
||
testing whether the onComplete method fired successfully in the RESTRequest is tricky. If onComplete is not a function, it does not crash, since it's fired on next tick. All we get is a 'JS Error' fprintf'd to stderr. Maybe there's a way we can listen to stderr in xpcshell and see if there's a JS Error?
Updated•12 years ago
|
Whiteboard: [qa-]
Comment 2•12 years ago
|
||
You can generally catch reported exceptions with an nsIConsoleService listener. But wouldn't it be easier to somehow test for "onComplete ran" rather than "calling onComplete didn't throw"?
Assignee | ||
Comment 3•12 years ago
|
||
This isn't really a reported exception - it's just written right to stderr. Wouldn't that be inaudible to an nsIConsoleService listener?
But to your main point, agreed: It would be best to positively verify that onComplete ran. I didn't at first go this way because my initial impulse was that I shouldn't modify the existing rest.js code. Perhaps the best way to answer this question is through exploring with a patch.
Comment 4•12 years ago
|
||
(In reply to Jed Parsons (use needinfo, please) [:jedp, :jparsons] from comment #3)
> This isn't really a reported exception - it's just written right to stderr.
Do you have a pointer?
Assignee | ||
Comment 5•11 years ago
|
||
I think the value of such tests would be low compared to the time required to perfect them. I opened this bug during some tense days, when I was nervous about anything that didn't have a test. From my perspective now, I think this is overkill. Please reopen if you think I'm wrong.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•