bug 1284946 - fix dialog parameter passing in browser_certViewer.js r?Cykesiopka draft
authorDavid Keeler <dkeeler@mozilla.com>
Thu, 07 Jul 2016 11:14:17 -0700
changeset 387702 82f60c46b39396cbfba08ad38a309c72dc79f122
parent 387623 08f8a5aacd8308a73f6040fe522be7ba38497561
child 387703 c63c8591140ce1ae6ca3b6f3f4da0e36f376640f
push id23044
push userdkeeler@mozilla.com
push dateThu, 14 Jul 2016 17:26:08 +0000
reviewersCykesiopka
bugs1284946, 1217602
milestone50.0a1
bug 1284946 - fix dialog parameter passing in browser_certViewer.js r?Cykesiopka The changes in bug 1217602 missed that browser_certViewer.js should have been updated to use a nsIDialogParamBlock instead of a (mock) nsIPKIParamBlock. "Luckily" the test harness completely ignored the errors resulting from this oversight. MozReview-Commit-ID: JlA62L5PPW8
security/manager/ssl/tests/mochitest/browser/browser_certViewer.js
--- a/security/manager/ssl/tests/mochitest/browser/browser_certViewer.js
+++ b/security/manager/ssl/tests/mochitest/browser/browser_certViewer.js
@@ -24,21 +24,17 @@ function test() {
   let certdb = Cc["@mozilla.org/security/x509certdb;1"]
                  .getService(Ci.nsIX509CertDB);
   let certList = certdb.getCerts();
   let enumerator = certList.getEnumerator();
   ok(enumerator.hasMoreElements(), "we have at least one certificate");
   let cert = enumerator.getNext().QueryInterface(Ci.nsIX509Cert);
   ok(cert, "found a certificate to look at");
   info("looking at certificate with nickname " + cert.nickname);
-  let arg = {
-    QueryInterface: function() {
-      return this;
-    },
-    getISupportAtIndex: function() {
-      return this.cert;
-    },
-    cert: cert
-  };
+  let array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
+  array.appendElement(cert, false);
+  let params = Cc["@mozilla.org/embedcomp/dialogparam;1"]
+                 .createInstance(Ci.nsIDialogParamBlock);
+  params.objects = array;
   gBugWindow = window.openDialog("chrome://pippki/content/certViewer.xul",
-                                 "", "", arg);
+                                 "", "", params);
   gBugWindow.addEventListener("load", onLoad);
 }