On 11/8/12 11:04 AM, Honza Bambas wrote:
On 11/8/2012 12:26 AM, Benjamin Smedberg wrote:
On 11/7/12 12:00 PM, Honza Bambas wrote:
Hi all.  I'd like to ask for help.

tl;dr: a new JS component needs to be accessible by xpcshell and
mochitest, how to do that?
It's not clear to me why this needs to be a component. Since we
already have testing-only modules working, can this just be a module?

--BDS

Thanks everybody for answers.  It seems to make this a module is a
better way here.

I think I know how to do it for xpcshell.  But I'm really not sure how
to do it for mochitests or simply in some general way any framework
could use it.

Test only modules are simply a resource:// registration. This registration needs to be hooked up to each test runner just once and then all tests can use it. You can do this by loading a special .manifest when launching the app or you can perform the resource registration at run-time using nsIResProtocolHandler.setSubstitution.

If a test runner doesn't currently support resource://testing-common/, please file a bug and let's get it implemented everywhere.

Alternatively, I suppose we could hack up the "main" manifest file to include resource://testing-common if ENABLE_TESTS is defined. But, that may linger in packaged builds. Another problem that would be solved if we had a common .manifest file for all the test runners...

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

Reply via email to