Open Bug 1361929 Opened 7 years ago Updated 2 years ago

XPCOMUtils.defineLazyServiceGetter() can't load a drop-in mock while Cc[].getService() could

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

People

(Reporter: timdream, Unassigned)

References

Details

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 [1] can be loaded by history.js correctly in [2], but it cannot be loaded by aboutDialog-appUpdater.js here [3]

[1] https://searchfox.org/mozilla-central/rev/b0e1da2a90ada7e00f265838a3fafd00af33e547/browser/components/preferences/in-content/tests/browser_advanced_update.js#12

[2] https://searchfox.org/mozilla-central/rev/b0e1da2a90ada7e00f265838a3fafd00af33e547/toolkit/mozapps/update/content/history.js#17-19

[3] 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
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.