Bug 1564221 - Remove QueryInterface parameter from MockSecurityInfo in devtools tests r=ochameau

The `MockSecurityInfo` instances in the patched devtools tests are not actually
being used as `nsITransportSecurityInfo` instances; while `QueryInterface`
methods were generated for the them, these were never called. Additionally, the
methods they are being passed to are not XPCOM-defined and therefore do not
strictly require `nsITransportSecurityInfo`.

Differential Revision: https://phabricator.services.mozilla.com/D40521

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Barret Rennie 2019-08-06 15:37:05 +00:00
parent 3df3c840f0
commit bdc312d909
3 changed files with 10 additions and 3 deletions

View File

@ -32,8 +32,10 @@ const MockCertificate = {
},
};
// This *cannot* be used as an nsITransportSecurityInfo (since that interface is
// builtinclass) but the methods being tested aren't defined by XPCOM and aren't
// calling QueryInterface, so this usage is fine.
const MockSecurityInfo = {
QueryInterface: ChromeUtils.generateQI([Ci.nsITransportSecurityInfo]),
securityState: wpl.STATE_IS_SECURE,
errorCode: 0,
cipherName: "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",

View File

@ -18,8 +18,11 @@ Object.defineProperty(this, "NetworkHelper", {
});
const wpl = Ci.nsIWebProgressListener;
// This *cannot* be used as an nsITransportSecurityInfo (since that interface is
// builtinclass) but the methods being tested aren't defined by XPCOM and aren't
// calling QueryInterface, so this usage is fine.
const MockSecurityInfo = {
QueryInterface: ChromeUtils.generateQI([Ci.nsITransportSecurityInfo]),
securityState: wpl.STATE_IS_BROKEN,
errorCode: 0,
// nsISSLStatus.TLS_VERSION_1_2

View File

@ -19,8 +19,10 @@ Object.defineProperty(this, "NetworkHelper", {
const wpl = Ci.nsIWebProgressListener;
// This *cannot* be used as an nsITransportSecurityInfo (since that interface is
// builtinclass) but the methods being tested aren't defined by XPCOM and aren't
// calling QueryInterface, so this usage is fine.
const MockSecurityInfo = {
QueryInterface: ChromeUtils.generateQI([Ci.nsITransportSecurityInfo]),
securityState: wpl.STATE_IS_SECURE,
errorCode: 0,
cipherName: "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256",