Closed
Bug 1428845
Opened 6 years ago
Closed 6 years ago
Use TestUtils.waitForCondition in preferences tests
Categories
(Firefox :: Settings UI, enhancement, P5)
Tracking
()
RESOLVED
FIXED
Firefox 60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: johannh, Assigned: rofael, Mentored)
Details
Attachments
(1 file)
There's a waitForCondition function in preferences/in-content/tests/head.js[0] which is not needed because we can simply use TestUtils.waitForCondition[1] instead. We need to delete the function and replace all its occurrences[2] with TestUtils.waitForCondition. [0] https://searchfox.org/mozilla-central/rev/f42618c99dcb522fb674221acfbc68c2d92e7936/browser/components/preferences/in-content/tests/head.js#145 [1] https://searchfox.org/mozilla-central/rev/f42618c99dcb522fb674221acfbc68c2d92e7936/testing/modules/TestUtils.jsm#116 [2] https://searchfox.org/mozilla-central/search?q=%5Cswaitforcondition&case=false®exp=true&path=browser%2Fcomponents%2Fpreferences%2Fin-content%2Ftests
Reporter | ||
Updated•6 years ago
|
Summary: Use BrowserTestUtils.waitForCondition in preferences tests → Use TestUtils.waitForCondition in preferences tests
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•6 years ago
|
||
I removed [0] and added "TestUtils." to everything in [2]. I ran all the modified tests and didn't get any syntax errors.
Reporter | ||
Updated•6 years ago
|
Assignee: nobody → me
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•6 years ago
|
||
mozreview-review |
Comment on attachment 8944595 [details] Bug 1428845 - Removed duplicate definition of waitForCondition(). https://reviewboard.mozilla.org/r/214758/#review220472 That looks good to me! Thank you! Let's give it a quick try run and land it when that succeeds!
Attachment #8944595 -
Flags: review?(jhofmann) → review+
Pushed by jhofmann@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d03b6d9fff4 Removed duplicate definition of waitForCondition(). r=johannh
Backout by aiakab@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/be344306e4bb Backed out changeset 4d03b6d9fff4 for failing browser chrome on browser/components/preferences/in-content/tests/browser_applications_selection.js
Assignee | ||
Comment 6•6 years ago
|
||
Oops... https://dxr.mozilla.org/mozilla-central/source/browser/components/preferences/in-content/tests/browser_applications_selection.js#36 and https://dxr.mozilla.org/mozilla-central/source/browser/components/preferences/in-content/tests/browser_applications_selection.js#51 try to load the actionsMenu into a var, but it returns null! Turns out that TestUtils.waitForCondition doesn't resolve anything (https://searchfox.org/mozilla-central/source/testing/modules/TestUtils.jsm#139), whereas the one in head.js (https://searchfox.org/mozilla-central/source/browser/components/preferences/in-content/tests/head.js#151) resolves with the output of the function passed into. TestUtils.wfc does run the function passed into it and stores the result in conditionPassed. I'm going to try resolve(conditionPassed) and see if that passes the tests (and doesn't break anything else)
Assignee | ||
Comment 7•6 years ago
|
||
That was exactly the problem! I'm running all of browser/components/preferences/in-content/tests/ right now to check that it didn't unintentionally break something else. I'll push it to review as soon as that's dealt with.
Comment hidden (mozreview-request) |
Assignee | ||
Updated•6 years ago
|
Attachment #8944595 -
Flags: review+ → review?(jhofmann)
Reporter | ||
Comment 9•6 years ago
|
||
mozreview-review |
Comment on attachment 8944595 [details] Bug 1428845 - Removed duplicate definition of waitForCondition(). https://reviewboard.mozilla.org/r/214758/#review220794 Ah, yeah, that seems like a logical improvement to me, let's see whether it breaks anything. I wonder why the try run didn't fail, though... In any case, it seems like you'd benefit from having access to the Try server yourself. This page shows you how to get level 1 access: https://wiki.mozilla.org/ReleaseEngineering/TryServer#Getting_access_to_the_Try_Server. I'm happy to vouch for you. Great work! ::: testing/modules/TestUtils.jsm:113 (Diff revision 2) > * @param attempts > * The number of times to poll before giving up and rejecting > * if the condition has not yet returned true. Defaults to 50 > * (~5 seconds for 100ms intervals) > * @return Promise > * Resolves when condition is true. Please add a note that it resolves with the return value of the condition function here.
Attachment #8944595 -
Flags: review?(jhofmann) → review+
Reporter | ||
Comment 10•6 years ago
|
||
Previous try run was here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d19409d5d292 New try run here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f578eeda4dbb58b79fba70b11613ec156a740f46
Reporter | ||
Comment 11•6 years ago
|
||
Try didn't fail because of https://dxr.mozilla.org/mozilla-central/rev/c4ebc8c28a33b785dfbfa533810517cc707d1ad0/browser/components/preferences/in-content/tests/browser.ini#14 *sigh*
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•6 years ago
|
||
(In reply to Johann Hofmann [:johannh] from comment #9) Okay, I just pushed that change to review. I also made a request for level 1 access (bug 1432957). Thanks for the vouch!
Reporter | ||
Comment 14•6 years ago
|
||
Great, let's get this landed!
Comment 15•6 years ago
|
||
Pushed by jhofmann@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef78d4e91a01 Removed duplicate definition of waitForCondition(). r=johannh
Comment 16•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ef78d4e91a01
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in
before you can comment on or make changes to this bug.
Description
•