Closed
Bug 1144797
Opened 10 years ago
Closed 10 years ago
Add a utility jsm into the scope of ContentTasks
Categories
(Testing :: Mochitest, defect)
Testing
Mochitest
Tracking
(e10s+, firefox40 fixed)
People
(Reporter: smacleod, Assigned: mconley, Mentored)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
It would be great to have a common JSM loaded into the scope of any spawned ContentTasks where common utility methods could live. I'm thinking something like BrowserTestUtils introduced in Bug 1093566.
Flags: firefox-backlog+
Reporter | ||
Updated•10 years ago
|
Mentor: smacleod
![]() |
||
Updated•10 years ago
|
Blocks: e10s-tests
Assignee | ||
Comment 1•10 years ago
|
||
/r/6227 - Bug 1144797 - Add setInterval and clearInterval to Timer.jsm. r=?
/r/6229 - Bug 1144797 - Add ContentTestUtils.jsm into ContentTask scope. r=?
Pull down these commits:
hg pull review -r 90967c8b6dc47f638d3dcc5eb073f304639f8c65
Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8584859 [details]
MozReview Request: bz://1144797/mconley
/r/6227 - Bug 1144797 - Add setInterval and clearInterval to Timer.jsm. r=?
/r/6229 - Bug 1144797 - Add ContentTestUtils.jsm into ContentTask scope. r=?
Pull down these commits:
hg pull review -r 90967c8b6dc47f638d3dcc5eb073f304639f8c65
Attachment #8584859 -
Flags: review?(smacleod)
Reporter | ||
Comment 3•10 years ago
|
||
https://reviewboard.mozilla.org/r/6227/#review5297
::: toolkit/modules/tests/xpcshell/test_timer.js
(Diff revision 1)
> -function run_test(browser, tab, document) {
> - do_test_pending();
> +function run_test() {
> + run_next_test();
> +}
You should be able to remove this since you're using add_task, no?
Reporter | ||
Comment 4•10 years ago
|
||
https://reviewboard.mozilla.org/r/6229/#review5295
::: testing/mochitest/BrowserTestUtils/moz.build
(Diff revision 1)
> + 'ContentTestUtils.jsm',
ContentTasks are used in tests only - so instead of including "test" in the name I think I'd prefer "ContentTaskUtils".
::: testing/mochitest/BrowserTestUtils/ContentTestUtils.jsm
(Diff revision 1)
> + promiseCondition(condition, msg, interval=100, maxTries=50) {
With the other new unified test modules BrowserTestUtils and TestUtils we're avoiding the "promise<blah>" names and prefering "<thing><verbed>" or "waitFor<thing>" since everything returns a promise.
How about "conditionMet" or "waitForCondition"?
::: testing/mochitest/BrowserTestUtils/ContentTestUtils.jsm
(Diff revision 1)
> +const { utils: Cu } = Components;
Lets go ahead and bring them all in:
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8584859 [details]
MozReview Request: bz://1144797/mconley
https://reviewboard.mozilla.org/r/6225/#review5299
Fix it, then ship-it!
Attachment #8584859 -
Flags: review?(smacleod) → review+
Assignee | ||
Comment 6•10 years ago
|
||
https://reviewboard.mozilla.org/r/6227/#review5301
> You should be able to remove this since you're using add_task, no?
That's what I thought too - but apparently, xpcshell tests are special. :/
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Writing_xpcshell-based_unit_tests#XPCShell_test_utility_functions
Assignee | ||
Comment 7•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Whiteboard: [fixed-in-fx-team]
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c56d6f0226f2
https://hg.mozilla.org/mozilla-central/rev/41038ff05418
Assignee: nobody → mconley
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla40
Updated•10 years ago
|
Iteration: --- → 40.1 - 13 Apr
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8584859 -
Attachment is obsolete: true
Attachment #8619801 -
Flags: review+
Attachment #8619802 -
Flags: review+
Assignee | ||
Comment 10•10 years ago
|
||
Assignee | ||
Comment 11•10 years ago
|
||
Updated•8 years ago
|
Component: BrowserTest → Mochitest
You need to log in
before you can comment on or make changes to this bug.
Description
•