External Protocol Service cannot be unregistered for tests
Categories
(Thunderbird :: General, defect)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Unassigned)
References
Details
(Keywords: regression, Whiteboard: [thunderbird-disabled-test])
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
In shared-modules/test-content-tab-helpers.js, we mock the external protocol service so we can test clicking on links. This is broken:
var contract = "@mozilla.org/uriloader/external-protocol-service;1";
var cid = Components.manager.contractIDToCID(contract);
var classObj = Components.manager.getClassObject(cid, Ci.nsIFactory);
Components.manager.unregisterFactory(cid, classObj);
[Exception... "Component returned failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIComponentRegistrar.unregisterFactory]" nsresult: "0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED)" location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1" data: no]
I'm disabling a test in newmailaccount/test-newmailaccount.js. There's one in cloudfile/test-cloudfile-manager.js too, which is already disabled for bug 1522778.
Comment 3•6 years ago
|
||
Hard to tell after four days of bustage.
Reporter | ||
Comment 4•6 years ago
|
||
I clearly forgot to mention this is also the case in Firefox but they obviously don't try to do it or there'd be broken tests.
Comment 5•6 years ago
|
||
Geoff, can you give some STR for FF and then NI Alice (alice0775@gmail.com) to kindly find the regression for us.
Comment 7•6 years ago
|
||
Alice, can you please find regression with the code in comment #0. Thanks in advance.
Comment 8•6 years ago
|
||
Open Browser Console
Paste the following code and press ENTER key
var contract = "@mozilla.org/uriloader/external-protocol-service;1";
var cid = Components.manager.contractIDToCID(contract);
var classObj = Components.manager.getClassObject(cid, Ci.nsIFactory);
Components.manager.unregisterFactory(cid, classObj);
No error on Firefox65.
Error on Nightly67.0a1.
Regression window:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=91f5131e326ad99acb9a44567c9c08d3d1f8b06b&tochange=7ea334118c82e3609be2a1cfa3c5b867017c4937
Comment 9•6 years ago
|
||
Kris, this is not intentional, is it? What can be done to restore this function?
Comment 10•6 years ago
|
||
It is intentional, yes. Static components cannot be unregistered. You can override them by registering a new component with the same contract ID, though.
Comment 11•6 years ago
|
||
Thanks, Kris. Moving this back to the TB queue.
Reporter | ||
Comment 12•6 years ago
|
||
Should I be able to unregister the override? unregisterFactory
doesn't complain, but if I then try to get the original service (e.g. in the next test) NS_ERROR_XPC_GS_RETURNED_FAILURE
is thrown.
Reporter | ||
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/4ba6ad8570e5
Backed out changeset b6cc6a64d219 to re-enable tests fixed by bug 1528437. a=backout
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Description
•