Last week we landed bug 567417 which allows us to run mochitests on a IPC enabled build. For non IPC builds, this works almost exactly the same (other than a check to see if we can set preferences.)
What exactly does this patch do:
- adds a xul overlay to mochikit.manifest to load up the chrome half of the test harness
- sends –log-file (init, log, close) function calls through a dispatchEvent into messageManager.loadFrameScript code. Event listener then calls the same init, log, close functions and has access to write to a file.
- sends quit message through dispatchEvent into messageManager.loadFrameScript code which then sends a message to chrome (proper) which does the quit.
- duplicates SimpleTest.waitForFocus in messageManager.loadFrameScript code. This is a bit hairy as we need to set focus, but window.focus needs pure chrome, so we send a message to the chrome (proper) process. I think future work can be done to make this better and cleaner.
Originally this patch was intended to include the overlay on all mochitest style testing (chrome, browser-chrome, a11y, plain) but we ran into issues with the focus code when chrome tests would open a new window (the ipc listening code was not loaded, so events would be dispatched but not received). The code is not needed for anything but mochitest-plain, which is why we only use it there.
There is still a lot of work to be done in order to get these tests running green on a Firefox desktop build with IPC. The target for this month was getting it running in general which will be used for Fennec (about 85% of the test files run successfully now). Here are a few things we need to resolve for complete runs:
- Support WindowSnapshot functionality (reftest style tests)
- Support EventUtils (mouse and keyboard events)
- Update dom/…/ajax tests with IPC enabled harness
- Support WaitForClipboard functionality
- Edit all tests that use elevated privileges to use a proxy library of some kind or migrate to mochitest-chrome tests
A really cool thing is this post has been translated to
Belorussian
provided by PC.