On Wed, Oct 22, 2014 at 6:29 AM, Benjamin Smedberg <benja...@smedbergs.us> wrote: > Is there a mechanism for running single gtests that start XPCOM? > > 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 > * 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 > > I am currently attempting to convert at a few C++ unit tests which start > XPCOM and also end up using bits of JSAPI: > > toolkit/components/places/tests/cpp/test_IHistory.cpp uses JSAPI via > nsINode->nsWrapperCache->RootingAPI > media/webrtc/signalingtest uses nsPIDOMWindow -> nsINode -> nsWrapperCache > -> RootingAPI > > I'd like to convert these to be use the gtest-libxul. Do we have a framework > for gtests that start XPCOM and therefore need to be run one at a time > rather than using the normal parallel-gtest mechanism? > > --BDS > > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform
I've been wanting this too. I was thinking about just making the gtest harness itself start XPCOM. - Kyle _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform