Bug 1456035: Follow-up: Fix wrapper error in plain mochitest. r=bustage
authorKris Maglione <maglione.k@gmail.com>
Wed, 25 Apr 2018 17:37:24 -0700
changeset 471771 3e771c2f48b037b8fa9b6be2c4634e8debd2a2d1
parent 471770 63241afeab2051961234964ef091add0bde387cc
child 471772 595101eb4739f648080e23c5561ff27eb812a4cd
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1456035
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456035: Follow-up: Fix wrapper error in plain mochitest. r=bustage MozReview-Commit-ID: BsZOhFIuDLv
dom/tests/mochitest/bugs/test_bug61098.html
--- a/dom/tests/mochitest/bugs/test_bug61098.html
+++ b/dom/tests/mochitest/bugs/test_bug61098.html
@@ -32,17 +32,22 @@ function registerMockPromptService()
   var XPCOMUtils = SpecialPowers.Cu.import("resource://gre/modules/XPCOMUtils.jsm").XPCOMUtils;
   var Ci = SpecialPowers.Ci;
 
   function MockPrompt(aDOMWindow) {
     this.domWindow = SpecialPowers.unwrap(aDOMWindow);
   }
 
   MockPrompt.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIPrompt]),
+    QueryInterface(iid) {
+      if (iid.equals(Ci.nsIPrompt)) {
+        return this;
+      }
+      throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
+    },
 
     domWindow : null,
 
     _toggleModalState: function()
     {
       // The real prompt service puts the window into a modal state
       // immediately before showing a modal prompt, and leaves the modal state
       // when the prompt is dismissed by the user. This mock prompt doesn't
@@ -149,17 +154,22 @@ function registerMockPromptService()
   // Override the prompt service with our own so that we can test
   // modal dialogs
 
   function MockPromptService()
   {
   }
 
   MockPromptService.prototype = {
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIPromptFactory, Ci.nsIPromptService]),
+    QueryInterface(iid) {
+      if (iid.equals(Ci.nsIPromptFactory) || iid.equals(Ci.nsIPromptService)) {
+        return this;
+      }
+      throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
+    },
 
     getPrompt: function(aDOMWindow, aIID)
     {
         return new MockPrompt(aDOMWindow);
     },
 
     alert: function(aParent, aDialogTitle, aText)
     {