Closed
Bug 506380
Opened 15 years ago
Closed 15 years ago
Need an assertNotChecked method
Categories
(Testing Graveyard :: Mozmill, defect)
Testing Graveyard
Mozmill
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: u279076, Assigned: u279076)
Details
(Whiteboard: [verified-mozmill-1.2.1])
Attachments
(2 files, 2 obsolete files)
1.18 KB,
patch
|
cmtalbert
:
review+
|
Details | Diff | Splinter Review |
573 bytes,
patch
|
cmtalbert
:
review+
|
Details | Diff | Splinter Review |
Mozmill has an assertChecked method but no assertNotChecked method. This is handy when checking that certain prefs are supposed to be not checked.
Attachment #390565 -
Flags: review?
Attachment #390565 -
Attachment is obsolete: true
Attachment #390572 -
Flags: review?
Attachment #390565 -
Flags: review?
Original patch checked if checked == false which is incorrect. If a box is unchecked it can be !true or non-existant. Updated the if to check if hasAttribute("checked") or checked != true.
Comment on attachment 390572 [details] [diff] [review] Rev1 Next time, dont' forget to put an id in the review request ;) The only thing I'd change here would be to add one more item to the if statement and that is: if (n && !n.hasAttribute... That way in case el.getNode returns null we don't just die. I'll make that change when I check it in. Thanks for the patch!! r=ctalbert
Attachment #390572 -
Flags: review? → review+
"bug506275" [New] 25L, 890C written host-2-8:mozmill clint$ svn commit -m "Bug 506380, patch by Ashughes, r=ctalbert, Add assertNotChecked method to controller.js" mozmill/extension/resource/modules/controller.js Sending mozmill/extension/resource/modules/controller.js Transmitting file data . Committed revision 535. Itook out the commented out line of the // window.focus() call and added in a if statement so that we'd throw with an appropriate error message in case el.getNode() returned null. --> FIXED
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 6•15 years ago
|
||
Comment on attachment 390572 [details] [diff] [review] Rev1 >+ var n = el.getNode(); >+ >+ if (!n.hasAttribute("checked") || n.checked != true){ >+ frame.events.pass({'function':'Controller.assertNotChecked()'}); >+ return true; >+ } For consistency it would have been nice to name it element instead of n. Clint, can you please make the change with the upcoming assertPropertyNotExist checkin?
Updated•15 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [verified-mozmill-1.3]
Updated•15 years ago
|
Whiteboard: [verified-mozmill-1.3]
Comment 7•15 years ago
|
||
Comment on attachment 390572 [details] [diff] [review] Rev1 >+ var n = el.getNode(); >+ >+ if (!n.hasAttribute("checked") || n.checked != true){ >+ frame.events.pass({'function':'Controller.assertNotChecked()'}); >+ return true; >+ } As already said please rename 'n' to 'element'. >+ throw new Error("assert failed for checked element " + el.getInfo()); >+ return false; The assert message is wrong. It should be named "assert failed for not checked element ". We have to update this.
Are you going to back out the patch or should I just write an incremental patch...
Comment 9•15 years ago
|
||
An incremental patch would be fine I think. There is no need to let Clint or Mikeal do twice that work.
Assignee | ||
Comment 10•15 years ago
|
||
Revisions made...
Attachment #390572 -
Attachment is obsolete: true
Comment 11•15 years ago
|
||
Comment on attachment 391398 [details] [diff] [review] Rev2 Clint, can you please review?
Attachment #391398 -
Flags: review?(ctalbert)
Comment 12•15 years ago
|
||
Comment on attachment 391398 [details] [diff] [review] Rev2 r=ctalbert. My apologies to Anthony for having to waste time on this. This is not user facing code, and the code was absolutely clear before this change in my opinion. There was no reason to reopen this bug whatsoever. But thank you for the patch. I'll check it in.
Attachment #391398 -
Flags: review?(ctalbert) → review+
Comment 13•15 years ago
|
||
Transmitting file data . Committed revision 538.
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Comment 14•15 years ago
|
||
(In reply to comment #12) > r=ctalbert. My apologies to Anthony for having to waste time on this. This is > not user facing code, and the code was absolutely clear before this change in > my opinion. There was no reason to reopen this bug whatsoever. But thank you The wrong assert error text is definitely user facing code which would be wrongly inserted into the result server at a later stage. So I still think it was worth fixing it. The element renaming was just a side effect. The last patch has broken the assertNotChecked function. Follow-up patch upcoming.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 15•15 years ago
|
||
Just a small note. Please test your patches before attaching it to the bug. That would eliminate those follow-ups.
Attachment #391816 -
Flags: review?(ctalbert)
Attachment #391816 -
Flags: review?(ctalbert) → review+
Comment 17•15 years ago
|
||
Comment on attachment 391816 [details] [diff] [review] Follow-up (In reply to comment #15) > Created an attachment (id=391816) [details] > Follow-up > > Just a small note. Please test your patches before attaching it to the bug. > That would eliminate those follow-ups. Crap! I assumed the patch was tested and only looked at the diff in bugzilla since it was a simple patch. Thanks for catching it Henrik. My bad. Do we have a bug open on unit testing mozmill API's? I'm tired of getting bit by things like this :( We started out with doing that, but then it fell aside. Again, my bad. I'll file a follow on bug for one if one doesn't exist.
Comment 18•15 years ago
|
||
r539 :( Fixed. Again. Dammit.
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 19•15 years ago
|
||
Crap...in all the confusion and back-n-forth I forgot to test this patch before attaching it to the bug. I apologize...
Comment 20•15 years ago
|
||
(In reply to comment #17) > Do we have a bug open on unit testing mozmill API's? I'm tired of getting bit > by things like this :( We started out with doing that, but then it fell aside. > Again, my bad. I'll file a follow on bug for one if one doesn't exist. We should not file new bugs for getting tests in. We have the in-testsuite flag which is a wonderful thing for this type of work. Each bug with in-testsuite? or an empty flag should be taken into account. There is only one bug with in-testsuite+ yet. Ok, this time we have it. Marking verified fixed for 1.3.
Status: RESOLVED → VERIFIED
Whiteboard: [verified-mozmill-1.3]
Updated•15 years ago
|
Whiteboard: [verified-mozmill-1.3] → [verified-mozmill-1.2.1]
Updated•8 years ago
|
Product: Testing → Testing Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•