Closed Bug 1007906 Opened 10 years ago Closed 10 years ago

Make the Addon Manager test/browser/run_next_test() function yield to the event loop before starting the next test

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: Irving, Assigned: Irving)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The xpcshell run_next_test() method starts the next async test case on a future spin of the event loop, but the mochitest version of run_next_test() is synchronous.

We should change the mochitest run_next_test so that it yields to the event loop before starting the next test, and also while we're at it, port the code from bug 972093 that detects calls to run_next_test() from add_task() style tests.
What is the mochitest run_next_test function?
Serves me right for not DXRing the heck out of this - it's local to toolkit/mozapps/extensions/test/browser/head.js.
Component: Mochitest → Add-ons Manager
Product: Testing → Toolkit
Summary: Make the mochitest run_next_test() function yield to the event loop before starting the next test → Make the Addon Manager test/browser/run_next_test() function yield to the event loop before starting the next test
That said, there are parallel implementations of add_test / run_next_test spread all over the tree and several others have the same bug; http://dxr.mozilla.org/mozilla-central/search?tree=mozilla-central&q=%22function%20run_next_test%22&redirect=true
(In reply to comment #2)
> Serves me right for not DXRing the heck out of this - it's local to
> toolkit/mozapps/extensions/test/browser/head.js.

lol, np :-)
Also removed a bunch of now-redundant "executeSoon(run_next_test)" wraps.
Assignee: nobody → irving
Status: NEW → ASSIGNED
Attachment #8422570 - Flags: review?(dtownsend+bugmail)
Attachment #8422570 - Flags: review?(dtownsend+bugmail) → review+
should we file another bug to fix this for all mochitests?
(In reply to Joel Maher (:jmaher) from comment #6)
> should we file another bug to fix this for all mochitests?

There isn't a global instance for mochitests. We should probably file a bug to make one.
Well, this *was* going to be the "fix it everywhere" bug until I realized that there were multiple implementations...

What Mossop said, with a side order of "I wish it wasn't too much work to change all the tests to be Task-style." I'd rather spend the time moving to a single implementation rather than fixing all the copies.
good_first_bug territory!  Lay the work out, maybe someone on the ateam could pick it up and do a big chunk of it.
I accidentally committed the part where I removed now-redundant executeSoon calls into the wrong patch, they're here now.
Attachment #8422570 - Attachment is obsolete: true
Attachment #8424509 - Flags: review?(dtownsend+bugmail)
Attachment #8424509 - Flags: review?(dtownsend+bugmail) → review+
https://hg.mozilla.org/mozilla-central/rev/a05f2483f74b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: