• 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
    • http://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/
    • 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 file
      • firefox-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
  • How to enable dump in a new profile
    • add user_pref("browser.dom.window.dump.enabled", true); to profiledir/user.js
  • How to execute test code with chrome privileges
    • using a chrome doc - see sbtests.xul in http://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
  • How to detect content onload event from chrome
    • use the DOMContentLoaded event
      • chromeWindow.addEventListener('DOMContentLoaded',callbackFunction,false);