It may be possible to use the new do_shutdown function (to be added in bug 511415) in <http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/update/test/unit/head_update.js.in#115>. I tried this but it lead to crashes in various tests. This might be worth investigating.
Created attachment 412580 [details] [diff] [review] patch in progress rev1 This should work for the majority if not all of the tests. There may be one or two where we want to verify things are cleaned up on shutdown and I noticed that the timer manager test doesn't complete if do_shutdown() is before do_test_finished() so it won't always be possible to use it.