SoftwareTesting:Tools:L10n:Coverage

From MozillaWiki
Jump to: navigation, search

L10n Coverage is an extension to test the Firefox UI and see if any errors show up. Most fatal errors are reported in the Error Console, so watching that will be a good indication of what's going wrong.

The extension provides a basic architecture for running scheduling tasks as well as three classes of tests for menus, preferences, and neterror pages. Those three tests are hooked up to two XUL pages.

Patches and enhancements are always welcome, please file bugs with patches, and CC l10n@.

Architecture

The architecture consists of an nsITimer, popping items from a stack every time it is triggered. These items can themselves push items on the stack again. The central object here is

Stack = {
  push: function(aItem) {...},
  ...
}

The items to be pushed should implement

Item.prototype = {
  args: [],
  method: function _m(aArg1, ...) {
    // This is the method that actually does the work
  }
}

The method is invoked by

obj.method.apply(obj, obj.args);

setting both this and the arguments to the specified values.

If you have asynchronous tasks running, the best way to do this is to push a dummy item on the stack, that adds itself back onto the stack until the asynchronous task is finished. See loadAction in coverage-neterror.js for an example.

Entry points

There are currently two entry XUL pages, coverage.xul running the menu and preferences tests, and neterror-coverage.xul running the neterror tests. The bundling is this way because neterror requires an iframe, and, because those two sets have a similar runtime.

Test categories

There are three kinds of tests, as of now, menus, preferences, and about:neterror pages. Some also distinguish research paper topics dissertation help assignment help essay help custom dissertation Link Building Service banc de swiss anyoption


Menus

This test opens the all menus and their child popups from the main menubar, and closes them again.


SEO India India’s top SEO Company India (SEO India). Trustworthy SEO services from best SEO experts in India. Top 10 Rank For Your Website. FREE SEO Analysis.

Seo Services India SEO services from India’s best SEO Company (SEO India) providing quality search engine optimization (SEO Services). First page Search Engine Rankings.

SEO公司在台北 Pensa Media是個領先同業的網路行銷公司。我們針對網路行銷,提供一系列的行銷企劃,包跨網頁設計、搜尋引擎優化、以及按點擊計費管理等等。

Preferences

This test opens the preference window, and loads each pane. Parsing errors in a pane will show up in the Error Console.

Network Error Pages

These tests load all error cases available in appstrings.properties in a faked neterror page by plain loading the about:neterror URLs corresponding to that. Passing the right arguments to the formatted strings requires a lot of detail hacking, so right now, all replaceable strings in the short descriptions are actually just replaced with the URL http://foo.bar.