Closed Bug 1388689 Opened 7 years ago Closed 7 years ago

createInstance(Ci.nsILocalFile) throws NS_ERROR_XPC_BAD_IID

Categories

(Core :: XPCOM, defect)

x86_64
Unspecified
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- unaffected
firefox57 --- fixed

People

(Reporter: cr, Assigned: cr)

References

Details

(Keywords: regression)

Current Firefox Nightly can't instantiate nsILocalFile in xpcshell. It worked fine until end of last week. This is urgent since it is breaking production QA automation. STR have been tested on Linux and Mac.


STR:

- Open an xpcshell, then
js> let f = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);


Result:

JavaScript error: typein, line 1: NS_ERROR_XPC_BAD_IID: Component returned failure code: 0x80570018 (NS_ERROR_XPC_BAD_IID) [nsIJSCID.createInstance]


Expected result:

- an nsILocalFile instance
Boris, is this perhaps specific to XPCShell?
Flags: needinfo?(bzbarsky)
Has Regression Range: --- → yes
Has STR: --- → yes
Keywords: regression
Target Milestone: --- → mozilla57
This is expected fallout from bug 1375215.  What sort of things is QA writing in xpcshell scripts?
Blocks: 1375125
Flags: needinfo?(bzbarsky)
Unless we find a workaround, it effectively kills things like the TLS Canary project[1]. We need this for loading custom profile directories like in [2].

[1] https://github.com/mozilla/tls-canary
[2] https://github.com/mozilla/tls-canary/blob/c2475ca6e750b081c5ab982350c2ef20ca0a972f/tlscanary/js/scan_worker.js#L61
Please replace nsILocalFile with nsIFile. nsILocalFile was a compatibility shim since five years ago (bug 682360).
Switching to nsIFile works for us. So simple. Thanks, Masatoshi!
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.