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.

Tags:

Comment [2]

  1. R · 2012-07-04 09:25 · #

    Ad block plus breaks this site:

    https://www.vsp.com/

    Reply from Wladimir Palant:

    Above the comment field it says: “Please note that comments not related to this blog post will be removed. For questions on Adblock Plus please use the forums.”

    Also, please see https://adblockplus.org/en/getting_started#false-positives

  2. Will · 2012-07-04 20:16 · #

    I hope you guys will find a way to disable that annoying script they provide on antiblog.org

    http://antiblock.org/?p=script

    Thanks,
    Will

    Reply from Wladimir Palant:

    I removed this comment as unrelated to the blog post – as usually. Feel free to report sites actually using that script to filter subscription authors, they will deal with it.

Commenting is closed for this article.