Running Tests From Extensions

From FirebugWiki
Revision as of 00:50, 18 May 2011 by Sebastianz (Talk | contribs) (Changed code blocks to use syntax highlighting)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page explains how to run tests from Firebug extensions.

Run Tests From Extensions[edit]

Firebug test harness allows also running tests from all installed extensions at once. This make possible to not only test Firebug itself, but also all installed extensions and possible conflicts among them.

In order to automatically load exposed test suites from extensions into the test console you need to write following URL into the FBTest Console's address bar (test list url) and press Enter.


The second option is to right click on the above address bar and pick Load Registered Tests.

As soon as you see all tests loaded (tests from Firebug itself are loaded too), you can press Run All on the toolbar as usual.

Expose Tests From an Extension[edit]

In order to get test-list URLs from installed extensions, the test console dispatches an event to all modules as follows:

var testLists = [];
dispatch(Firebug.modules, "onGetTestList", [testLists]);

An extension can handle the event and expose its test-list URL:

Firebug.FireCookieModule = extend(Firebug.Module,
    onGetTestList: function(testLists)
            extension: "Firecookie",
            testListURL: "chrome://firecookie/content/testList.html"