Archive for April, 2011

Writing browser chrome mochitests

Thursday, April 28th, 2011

My fellow developers,

You may already be writing good browser chrome tests that properly reset any side effects your test may have caused, but do you always clean up? Instead of manually cleaning up your test after a successful run, please consider using registerCleanupFunction. You can register as many functions as you like, and they are guaranteed to run at the end of the test! I didn’t know this technique existed until recently, so I thought I’d pass it along.

Unfortunately, I’m not aware of anything similar for other mochitests.

Bugzilla Happy URLs

Wednesday, April 6th, 2011

Ever accidentally copy-pasted a process_bug.cgi link? I’ve just written a quick extension that uses the history API to fix Bugzilla so that it shows the proper canonical URL for a resource after POSTing.

Download the Extension
GitHub page

Update: Bugzilla Tweaks already has this functionality.