- TODO:
- check example code in to the tree somewhere
- How to quit the browser on all platforms
- window.close() of the last open window does not quit the application on Mac
- https://people.mozilla.com/~davel/scripts/ - look at quit.js and quit.xul
- install manifest file in appdir/chrome to map chrome://tests/content to directory containing quit.js and quit.xul
- example:
content tests file:///Users/davel/Work/tests/
- example:
- start app with command line flag
-chrome chrome://tests/content/quit.xul
- How to create a new profile from the command line
- First, use the
-CreateProfile
command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js filefirefox-bin -CreateProfile "testprofile ${PROFILE_DIR}/testprofile"
- Next, start firefox to populate the new profile directory with the rest of the default settings
firefox-bin -P testprofile -chrome chrome://tests/content/quit.xul<code>
- the above process may exit before the profile is completely created. In test scripts, <code>sleep 5 after the above command should ensure the profile is created before the next command in the test script is run
- First, use the
- How to enable
dump
in a new profile- add
user_pref("browser.dom.window.dump.enabled", true);
to profiledir/user.js
- add
- How to execute test code with chrome privileges
- using a chrome doc - see sbtests.xul in https://people.mozilla.com/~davel/scripts/ for an example
firefox-bin -P sbtestprofile -chrome chrome://sbtests/content/
- above code calls the quit function in quit.js to exit after test is finished
- using a chrome doc - see sbtests.xul in https://people.mozilla.com/~davel/scripts/ for an example
- How to detect content onload event from chrome
- use the
DOMContentLoaded
eventchromeWindow.addEventListener('DOMContentLoaded',callbackFunction,false);
- use the