After setting up a development environment you can start tinkering with the code.
From the source code's root directory run:
make
# or
make xpi
The XPI file will be created at dist/requestpolicy.xpi
.
You can simply drag-and-drop the file into your web browser (e.g. Firefox).
mozrunner
is a python package that helps you run Mozilla binaries (firefox, thunderbird, seamonkey, …) in a predefined environment. Every time you run mozrunner
, it will create a new temporary profile – it will be deleted afterwards.
Usage examples:
# Run Firefox Nightly
# -- binary path: .mozilla/software/firefox/nightly/firefox
make run
This will also automatically create or update the XPI file, if necessary. In this case the „unit testing“ XPI will be created – command: make unit-testing-xpi
.
Setting up an environment for unit testing is optional. You probably won't need it if you do just a few changes to the code.
Unit testing (wikipedia) aims at ensuring that functionality that has been implemented is really working, also across different versions and also in case bigger changes to the source code are done.
There are two types of unit tests: xpcshell tests and Marionette tests. There are also still some MozMill tests, but they will be converted to Marionette tests, see issue #641.
Marionette (and formerly MozMill) is used to test UI functionality, whereas the xpcshell is used for tests which only need access to XPCOM.
So far there are only few unit tests, so contributions are very welcome. In future any new feature should get a unit test.
./tests/run-xpcshell-tests.sh
make marionette
Note that while the tests are running you shouldn't use keyboard/mouse at all, otherwise tests might fail erroneously.
make mozmill