Running Firefox tests with extensions installed

When debugging a test, I’ve sometimes found it useful to have access to an extension such as DOM Inspector or Firebug to debug what’s going on with the test.  In the past, you could do this by a bunch of hacks to make sure that you get the extension inside the test profile folder in time so that the test harness doesn’t delete it for you.  But last week I landed a patch which enables you to do this more efficiently.  Here’s how the new setup works:

  1. You should download the extension’s XPI into your current directory.
  2. You should rename it into {addon-ID}.xpi, where addon-ID is the ID of the extension as specified in its install.rdf file.
  3. You should pass the name of the new XPI file to the –install-extension flag which runtests.py and runreftest.py scripts now accept.

For example, if you want to have Firebug when running the mochitest suite, here’s how you should start the suite:

python objdir/_tests/testing/mochitest/runtests.py --install-extension=firebug\@software.joehewitt.com.xpi

Happy debugging!

Tagged with: , ,
Posted in Blog
3 comments on “Running Firefox tests with extensions installed
  1. Mana says:

    Hi,
    How come I can’t submit comment for your previous posts in this template?
    Take care
    Look fwd to hear from you again
    Mana

  2. Ehsan Akhgari says:

    I’ve disabled commenting on older posts because of the number of spam comments that I used to get.

  3. Mana says:

    Got it, np! just wanna remind you some friends that encouraged you and push you to the forward on your post “Why I do what I do”, Someones that deeply loved you, I guess you’ll never forget them, right?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>