> John Gaunt wrote:
> > However I like the idea of having XULRunner Unit-tests even more. I was
> > talking with Steve_k today and discussing options with command line
> > handlers and possbily heading off app startup in order to run unit tests
> > in a full xulrunner environment without UI coming up.
> > I have a test commandline handler written and I can stop the UI from
> > showing by setting "cmdLine.preventDefault = true;". Beyond that I guess
> > just running an eval() of a script might work. Is there a better way,
> > maybe a component to use? I think at that point I'll have everything I
> > need/want to be able to test things.
> I just gave it a quick try, including the head.js and tail.js files
> from the xpcshell tests. Smells like a hack, but seems to work for my
> purpose. As you, I would really like to do a "make check" and do
> window-less unit-testing of XULRunner apps.
So, I've been playing a bit more with this. I've hacked the
xpcshell-simple harness so it fits my needs.
* test files go into the FINAL_TARGET of the application
* created a command line handler that when called with "-test", reads
all the files specified with -f and concats them into one big file it
This makes my tests run "inside" the XULRunner application, and "make
check" works as expected.
One problem is that when the application needs to register new
components, and thus restarts, the test fails. But besides from that it
seems to fit the bill.
Is there a bug created for this?
There is now.
Rob Campbell - rob...@mozilla.com