After bug 859601, there is now a timing component to accessing mozSettings. This causes the following test cases to fail when run individually or early in the mochitest run: dom/tests/mochitest/geolocation/test_mozsettings.html dom/tests/mochitest/geolocation/test_mozsettingsWatch.html The current mochitest division on try does not trigger this, but it was exposed while working on bug 847279. The solution recommend by reuben is to use addLoadEvent() to delay until mozSettings is available.
Created attachment 738320 [details] [diff] [review] Handle mozSettings async creation using addLoadEvent(). Try showing the problem: https://tbpl.mozilla.org/?tree=Try&rev=979663f54c28 Try showing fix (ignore the android tests): https://tbpl.mozilla.org/?tree=Try&rev=e0b860105578