Github Webapps MochiTest Repo
David Clarke
Hey just wanted to show everyone the portability / coolness of javascript test frameworks, and how you can achieve cross device api compatibility.
The example that I am going to show is the soon to be performed work on mozilla central to port the webapps extension into the mozilla code base.
The exciting part about this we get to test against code that hasn’t been written just yet. Now since the codebase i want to test will eventually be on mozilla central , but is currently not. I didn’t select the option of testing against a debug build.
Building Firefox:
https://developer.mozilla.org/En/Developer_Guide/Build_Instructions
MochiTest Basics:
https://developer.mozilla.org/en/Mochitest
Assuming you have built mozilla central and you are able to run MochiTests, then what next.Well firstly you will want to choose a location for your tests.
Now If you are working on webapps this directory might be: dom/tests/mochitest, as it looks as a lot of tests that are dom related lie there.
You will then have to create a directory “foobar“, and edit Makefile.in and add your directory below
DIRS +=
dom-level0
dom-level1-core
dom-level2-core
dom-level2-html
foobar
storageevent
$(NULL)
Next step would be to create a Makefile.in inside your directory foobar. Attached is a github commit which establishes our base repository.
https://github.com/dclarke/webapps-mochitest/commit/5f9d067b716229bcd9e0ceab2e2766263815bae7
https://github.com/dclarke/webapps-mochitest
First step is getting a working mozilla central source.