Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: XULRunner unit-tests like xpcshell

4 views
Skip to first unread message

beau...@gmail.com

unread,
Nov 6, 2006, 7:27:28 AM11/6/06
to
(moving to mozilla.dev.quality from .platform, since this really
belongs)

beau...@gmail.com wrote:
> 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
then evals()
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?

... Allan

Rob Campbell

unread,
Nov 7, 2006, 1:05:32 PM11/7/06
to
beau...@gmail.com wrote:
> (moving to mozilla.dev.quality from .platform, since this really
> belongs)
> [snip]

>
> Is there a bug created for this?

There is now.

https://bugzilla.mozilla.org/show_bug.cgi?id=359830

--
Rob Campbell - rob...@mozilla.com

0 new messages