no testability of nsINetworkLinkService
Categories
(Core :: Networking, defect)
Tracking
()
People
(Reporter: mixedpuppy, Unassigned)
References
Details
There doesn't seem to be any way to write an actual test for this.
The weirder part is that the tests that exist use io.offline, but as far as I can tell, flipping that actually has no effect on nsINetworkLinkService. The link status still says it's up.
Comment 1•5 years ago
|
||
That's true.
The problem is that nsINetworkLinkService responds directly to the device's connectivity, and especially in automation, we have no control over that. What we could do is to create a mock NetworkLinkService, similar to this and use that for some of the tests.
What do you think?
Reporter | ||
Comment 2•5 years ago
|
||
That may be worthwhile just to test consumers of the notifications. I think the tests trying to rely on io.offline should probably be addressed as well.
Reporter | ||
Comment 3•5 years ago
|
||
BTW, I've added a mock class in D30572 for bug 1550605.
Comment 4•5 years ago
|
||
(In reply to Shane Caraveo (:mixedpuppy) from comment #2)
That may be worthwhile just to test consumers of the notifications. I think the tests trying to rely on io.offline should probably be addressed as well.
So, Services.io.offline only reflects if the browser is in offline mode (unless you flip network.offline-mirrors-connectivity
). The mode does not reflect changes to nsINetworkLinkService, and nsINetworkLinkService notifications do not reflect changes to io.offline.
However, both of these are reflected in navigator.onLine
(the network.manage-offline-status
pref is relevant to this)
Thank you for adding a mock. I'm just going to dupe this to bug 1550605 unless you think there's separate work that needs to be done here.
Description
•