Right now, we have TestGeolocationProvider.js as part of the DOM and it is built when enable-tests is defined. We also have a default network geolocation provider installed. Both can not co-exists. In the mochitests, we make sure we are using the right one (via cid). In addition to what we are doing, i would like to NOT build the TestGeolocationProvider.js and instead just have it be part of the mochitest setup. For our releases on Mac OS, right now we are dependent on our build machines not building with tests. If they ever do, geolocation may start using this test file. Clint, what needs to be done to do this?
You should be able to override the component the same way we override the default nsITransfer implementation here: http://mxr.mozilla.org/mozilla-central/source/toolkit/content/tests/browser/browser_bug471962.js#133
having to manually register stuff is one way, the other is to just allow js components to be dropped in during the mochitest setup of the profile, right?
That sounds like a lot more work :) I agree that it would probably be useful, though I'm not sure there are that many cases where we currently need to do it.
gavin, either way, having the component be installed in dist/bin/components when tests is enabled is broken and needs to be fixed.
Yes. I'm suggesting you remove the component, and move it to some common test file (e.g. geolocation_common.js).
Attachment #374090 - Flags: review? → review?(ctalbert)
that last patch moved the component into shared code that is called by the mochitest for each test. It got pretty ugly because each function block needed a permissions call. I was also seeing some registration funkiness with repeated runs. I am not convinced that this is a good way to test.
the best approach is to convert these tests to browser-chrome
browser-chrome task: bug 489817
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.