On Wed, Oct 22, 2014 at 4:05 PM, Ted Mielczarek <t...@mielczarek.org> wrote:

> On 10/22/2014 9:29 AM, Benjamin Smedberg wrote:
> > Is there a mechanism for running single gtests that start XPCOM?
> Not that I know of currently. The gtest runner explicitly starts XPCOM
> before running tests[1].
> >
> > With the current gtest mechanism, "normal" gtests can't start XPCOM
> > (NS_InitXPCOM, event loops, component manager, etc) for various reasons:
> >
> > * gtests are run in parallel and XPCOM has globals and thread-locals
> > which don't allow that kind of multithreading
> This is actually not true, gtest doesn't support running tests in
> parallel at all[2].
>
> > * XPCOM doesn't support being re-initialized after it has been shut
> > down, and supporting that is a huge task that is unlikely to be a good
> > idea
> >
> > However, I've heard that there are some media tests which do
> > initialize XPCOM: https://wiki.mozilla.org/Media/WebRTC/Testing
> These are actually just CPP_UNIT_TESTS with a whole bunch of framework
> layered around them. They wind up linking a different version of the
> core code which tries to avoid linking the world[3]


Yes. This is a mess and has required a bunch of special case code
both to spin up XPCOM and to disable features of WebRTC which
depend on pieces of XUL that we weren't able to get going because
they pulled in too much of the world.

It would be great if there were a way not to do this.

-Ekr
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to