Closed Bug 1261272 Opened 4 years ago Closed 4 years ago

All Jetpack and Devtools test suites are going to permafail when Gecko 48 merges to Beta (resource://devtools/client/framework/about-devtools-toolbox.js:45 - TypeError: Cm.isCIDRegistered is not a function)

Categories

(DevTools :: Framework, defect, critical)

defect
Not set
critical

Tracking

(firefox46 unaffected, firefox47 unaffected, firefox48blocking fixed)

RESOLVED FIXED
Firefox 48
Tracking Status
firefox46 --- unaffected
firefox47 --- unaffected
firefox48 blocking fixed

People

(Reporter: RyanVM, Assigned: ochameau)

References

Details

Attachments

(1 file, 1 obsolete file)

[Tracking Requested - why for this release]: Mass devtools test bustage when Gecko 48 merges to Beta.

https://treeherder.mozilla.org/logviewer.html#?job_id=18725820&repo=try
Flags: needinfo?(poirot.alex)
Summary: All devtools tests are going to permafail when Gecko 48 merges to Beta (resource://devtools/client/framework/about-devtools-toolbox.js:45 - TypeError: Cm.isCIDRegistered is not a function) → All Jetpack and Devtools test suites are going to permafail when Gecko 48 merges to Beta (resource://devtools/client/framework/about-devtools-toolbox.js:45 - TypeError: Cm.isCIDRegistered is not a function)
devtools/about-devtools-toolbox.js uses |Cm.isCIDRegistered| as a function, where |Cm| is defined as:
const { Ci, Cu, Cm, components } = require("chrome");

I don't know much about this, but testing quickly locally in scratchpad, I always find isCIDRegistered to be undefined...

However, this seems to work for me:

let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.isCIDRegistered

I hope this helps.
I'm always surprised to see things being broken only after merges.
Is it due to just preference differences or is there some code difference ?!?

I imagine we can reproduce this issue with mozilla-central but with some tweaks in mozconfig to ask for a beta build?

(In reply to Patrick Brosset [:pbro] from comment #1)
> devtools/about-devtools-toolbox.js uses |Cm.isCIDRegistered| as a function,
> where |Cm| is defined as:
> const { Ci, Cu, Cm, components } = require("chrome");
> 
> I don't know much about this, but testing quickly locally in scratchpad, I
> always find isCIDRegistered to be undefined...
> 
> However, this seems to work for me:
> 
> let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
> registrar.isCIDRegistered
> 

Yes, that makes sense, Cm isn't necessarely "interfaced" to nsIComponentRegistrar, I imagine with beta prefs we disable some code that does it before about-devtools-toolbox.js...
Flags: needinfo?(poirot.alex)
Attached patch patch (obsolete) — Splinter Review
Attachment #8737134 - Flags: review?(jryans)
Comment on attachment 8737134 [details] [diff] [review]
patch

Review of attachment 8737134 [details] [diff] [review]:
-----------------------------------------------------------------

I think the "usual" way is to use the return value of the QI call to call whatever method is needed, as in:

https://dxr.mozilla.org/mozilla-central/source/js/xpconnect/tests/unit/test_xpcomutils.js#141

and many others.  Can you do that for this case?
Attachment #8737134 - Flags: review?(jryans)
Attached patch patch v2Splinter Review
Per QueryInterface behavior, it shouldn't be necessary.
But it is surprising to see so many usage where only the result of QI is used.
Attachment #8737167 - Flags: review?(jryans)
Attachment #8737134 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/fd4ef6fe328c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Ryan, just noticing that the target milestone is 48 but this landed in m-c (49) Does anything need uplift here?   
For your permafail bugs in general, I'll mark them as blockers.
It landed on m-c prior to Gecko 48 merging to Aurora, so we're good.
Assignee: nobody → poirot.alex
Flags: needinfo?(ryanvm)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.