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

NEW
Unassigned

Status

()

Core
XPCOM
P3
normal
a year ago
8 months ago

People

(Reporter: timdream, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

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

Updated

8 months ago
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.