Port registerCleanupFunction() method from mochitest browser-chrome to mochitest plain

RESOLVED FIXED in mozilla23

Status

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: whimboo, Assigned: ted)

Tracking

unspecified
mozilla23
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
The registerCleanupFunction method for Mochitest browser is very helpful if specific tasks have to be run before the test is finished. Mochitest plain is missing this feature and makes it hard to do the right cleanup logic for heavy asynchronous tests. It would be fantastic if we can get the method and related code ported over to mochitest plain.
Summary: Port registerCleanupFunction() method from mochitest chrome to mochitest plain → Port registerCleanupFunction() method from mochitest browser-chrome to mochitest plain
Created attachment 743185 [details] [diff] [review]
add registerCleanupFunction method to mochitest-plain

This does the trick.
Attachment #743185 - Flags: review?(jmaher)
Assignee: nobody → ted
Blocks: 815002
Comment on attachment 743185 [details] [diff] [review]
add registerCleanupFunction method to mochitest-plain

Review of attachment 743185 [details] [diff] [review]:
-----------------------------------------------------------------

I would like to see a test case that adds 2 cleanup functions.  The rest looks pretty safe.
Attachment #743185 - Flags: review?(jmaher) → review+
I made the sanity test set two prefs and use two separate cleanup functions to unset them, and check both of them in test_sanity_cleanup2:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e13bb42d2872
https://hg.mozilla.org/mozilla-central/rev/e13bb42d2872
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.