Adblock Plus and (a little) more

Where did the Adblock Plus unit tests go? · 2012-06-23 17:13 by Wladimir Palant

You probably asked yourself already what happened to the Adblock Plus unit tests. What? You didn’t? You don’t even know what unit tests are? Oops… Sorry about having bothered you. I guess nobody is reading past this point but I just have to explain it nevertheless.

Running our unit tests used to be complicated, you had to set up a development environment. And now that our development environment recommendation changed to Extension Auto-Installer running them became close to impossible. So I moved these unit tests into a separate (restartless) extension that can be used with a regular Adblock Plus build. You only have to install the development build of Adblock Plus unit tests and run the tests by typing chrome://adblockplustests/content/index.html into your location bar. So if you want to contribute to Adblock Plus and need a way to verify your changes — now you know how.

Running the tests from a compressed XPI package was a bit of a challenge, our old Mochitest version couldn’t get the list of tests from an archive. So I tried to update Mochitest — and noticed that Mochitest is fully of functionality that we don’t need, makes way too many assumptions and is generally too complicated. So I took this opportunity to switch to the QUnit test framework (thanks to Felix Dahlke for tipping me off). It fits our needs much better indeed, converting the unit tests isn’t always quite easy however. Most tests have been converted by now, only a few are still left in the old format.

I am glad that I’ve spent some time on this: I don’t know how I would be able to implement element hiding exceptions without them.



Commenting is closed for this article.