Closed Bug 635237 Opened 14 years ago Closed 14 years ago

Drop support for assertJS and waitForEval in Mozmill 2.0

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: ahal)

References

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 file)

Both assertJS and waitForEval are using the eval method to evaluate the given expression. This is faulty, can cause security holes, and should even not be ready for e10s. We should always use the callback way to make it asynchronous. The major jump to Mozmill 2.0 is the best time to get this fixed.
How does this work with/leverage the new assertion modules?
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
Would be a good replacement! The assertions module has been landed today in our refactoring repo and will be tested in the next couple of weeks.
Depends on: 634225
So is this bug basically just "Remove assertJS and waitForEval" from the controller? I can roll this up into the controller refactor if so.
From my standpoint yes. But I would like to get feedback from Clint.
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Clint, is this what was meant by drop support?
Attachment #522450 - Flags: review?(ctalbert)
Actually, should I remove waitForEval from utils.js as well?
(In reply to comment #6) > Actually, should I remove waitForEval from utils.js as well? That's what this bug is about: assertJS and waitForEval. So I would say yes.
Hmm, so I did a grep through the Thunderbird test automation and they seem to use "waitForEval" fairly frequently: http://pastebin.com/3bJJMb7F
On second look... I don't know why they are using waitForEval.. they could just use waitFor in (I think) all those cases.
Mark, do you have any objections in getting the waitForEval crap removed? It's insecure and with waitFor we have a much better way to get that done.
I'll let Andrew comment on if we need those or not.
Just for an example how waitFor and assert works, you can check: http://hg.mozilla.org/qa/mozmill-tests/file/default/tests/functional/testTabbedBrowsing/testBackgroundTabScrolling.js#l123 For Mozmill 2.0 we will have a complete new assertion library but waitFor will persist. See bug 637880.
I hate eval too; waitFor() does not appear to exist in MozMill 1.4.2 (and definitely did not exist when we started using mozmill), so we are not using it. It seems completely reasonable to remove it for 2.0 and we can change our existing usages. Do the new waitFor or other spin options support an optimized, non-polling form of loop spinning (backed by a single timer performing a timeout)? Something like a promise? A lot of the notifications we wait for in Thunderbird are actually event driven, so we end up setting some intermediary variable which the waitForEval then checks on a polling basis, which is less than optimal.
I'll remove waitForEval completely (from utils.js) pending ok from Clint.
(In reply to comment #13) > Do the new waitFor or other spin options support an optimized, non-polling form > of loop spinning (backed by a single timer performing a timeout)? Something > like a promise? A lot of the notifications we wait for in Thunderbird are > actually event driven, so we end up setting some intermediary variable which > the waitForEval then checks on a polling basis, which is less than optimal. Andrew, you should check the following class which is available pre 1.4.2: https://github.com/mozautomation/mozmill/blob/hotfix-1.5.2/mozmill/mozmill/extension/resource/modules/controller.js#L63
(In reply to comment #15) > Andrew, you should check the following class which is available pre 1.4.2: > https://github.com/mozautomation/mozmill/blob/hotfix-1.5.2/mozmill/mozmill/extension/resource/modules/controller.js#L63 That's not quite what I'm looking for; Thunderbird rarely generates DOM-style events for notifications, and it is still backed by the timer-based polling mechanism for loop-spinning (even on the master branch). What I want would be more like: let spinner = controller.gimmeSpinnerWithTimeout(ONE_SECOND); thunderbird.goDoSomething(spinner.thingToCallWhenAllDone); spinner.spinSpinSpinSpin(); Where the spin function would spin the event loop until either thingToCallWhenAllDone is invoked or the timeout expires. The timer would be canceled on success.
(In reply to comment #16) > That's not quite what I'm looking for; Thunderbird rarely generates DOM-style > events for notifications, and it is still backed by the timer-based polling > mechanism for loop-spinning (even on the master branch). Can you please file that as a new bug?
Comment on attachment 522450 [details] [diff] [review] Patch 1.0 - Remove assertJS and waitForEval I talked to Clint and he said to just go ahead and take out the methods. master: https://github.com/mozautomation/mozmill/commit/d02d4322e18ec96697c58d2904c7532df7fae995
Attachment #522450 - Flags: review?(ctalbert) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: