Open Bug 1361929 Opened 3 years ago Updated 2 years ago
.define Lazy Service Getter() can't load a drop-in mock while Cc.get Service() could
The patch in bug 1356507 caused failure like https://treeherder.mozilla.org/logviewer.html#?job_id=96179485&repo=autoland&lineNumber=3088 TEST-UNEXPECTED-FAIL | browser/components/preferences/in-content/tests/browser_advanced_update.js | uncaught exception - NS_ERROR_XPC_GS_RETURNED_FAILURE: Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService] at XPCU_serviceLambda@resource://gre/modules/XPCOMUtils.jsm:230:14 Further inspection shows that the mock here  can be loaded by history.js correctly in , but it cannot be loaded by aboutDialog-appUpdater.js here   https://searchfox.org/mozilla-central/rev/b0e1da2a90ada7e00f265838a3fafd00af33e547/browser/components/preferences/in-content/tests/browser_advanced_update.js#12  https://searchfox.org/mozilla-central/rev/b0e1da2a90ada7e00f265838a3fafd00af33e547/toolkit/mozapps/update/content/history.js#17-19  https://searchfox.org/mozilla-central/rev/b0e1da2a90ada7e00f265838a3fafd00af33e547/browser/base/content/aboutDialog-appUpdater.js#36-38 I am going to workaround this bug by loading the mock a little bit late in the test, but a proper fix should be figuring out why it breaks by inspecting the source of NS_ERROR_XPC_GS_RETURNED_FAILURE directly.
Summary: XPCOMUtils.defineLazyServiceGetter() can't load a dropped in mock while Cc.getService() could → XPCOMUtils.defineLazyServiceGetter() can't load a drop-in mock while Cc.getService() could
You need to log in before you can comment on or make changes to this bug.