Mobile/Fennec Chrome
Getting the Tests
Edit your mozconfig to contain the following lines:
ac_add_options --enable-tests
Get the source and build according to instructions.
to learn more about the tests, visit the MDC Guide]
Porting the tests to Fennec
Running Chrome tests on Fennec
Chrome tests are run just like mochitests except they have the --chrome flag set on the command line when launching.
Out of the box, these do not run on the device. You can run them on the desktop version of fennec which means that we are running into resource issues on the device.
I have followed the methods of running mochitests and have started running the chrome tests one directory at a time. This is trickier as you cannot specify a directory via the command line. Instead, I do this:
cd _tests/testing/mochitest cp -R chrome chrome.bak ## NOTE: you need to do the following steps in a look for each directory ## dirs: [content, docshell, dom, toolkit, widget] rm -Rf chrome/* cp -R chrome.bak/content chrome/ python runtests.py --appname=../../../../fennec --chrome --log-file=chrome_content.log --autorun --close-when-done
I have a basic python [script] which will achieve this. I still need to clean it up and make it accept command line arguments as well as stitch the chunked log files together.
TODO
- HACK: in order to work around bugs bug 472334 and bug 472341, we need to turn on sessionhistory by setting a user_pref("browser.sessionhistory.max_total_viewers", -1) in automation.py
- HACK: in order to get a [session store test] running, we need to set dom.storage.default_quota=640 in automation.py and change domstorage_global.js#88 from 32767 to 8191 in the for loop
- NOTE: these two hacks are discussed in bug 475098