Bug 1065185 - Fix extension manager test. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Fri, 03 Oct 2014 10:05:50 +0200
changeset 208538 7fe212396640d6efbf8af7a2a0785f075d112964
parent 208537 0e962be2f1262163e0e1530f238250eb5d86a1fd
child 208539 5f82762afba953e866884feb0cdc2e6d8bad57e0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz
bugs1065185
milestone35.0a1
Bug 1065185 - Fix extension manager test. r=bz
toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
--- a/toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
+++ b/toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
@@ -55,39 +55,39 @@
       lastResult = yield;
       is(lastResult.threw, true, "URI shouldn't resolve to begin with");
 
       let { AddonManager } = SpecialPowers.Cu.import("resource://gre/modules/AddonManager.jsm", {});
       const INSTALL_URI =
         "http://mochi.test:8888/tests/toolkit/mozapps/extensions/test/mochitest/file_bug687194.xpi"
       AddonManager.getInstallForURL(INSTALL_URI, (install) => {
         install = SpecialPowers.wrap(install);
-        install.addListener({
+        install.addListener(SpecialPowers.wrapCallbackObject({
           onInstallEnded: function(install, addon) {
             SimpleTest.executeSoon(() => test.next(addon));
           }
-        });
+        }));
         install.install();
       }, "application/x-xpinstall");
 
       let addon = SpecialPowers.wrap(yield);
 
       mm.sendAsyncMessage("test687194:resolveChromeURI",
                           { URI: "chrome://bug687194/content/e10sbug.js" });
       lastResult = yield;
       is(lastResult.threw, false, "able to resolve after the installation");
 
-      let listener = {
+      let listener = SpecialPowers.wrapCallbackObject({
         onUninstalled: function(removedAddon) {
-          if (SpecialPowers.wrap(removedAddon).id === addon.id) {
+          if (removedAddon.id === addon.id) {
             AddonManager.removeAddonListener(listener);
             SimpleTest.executeSoon(() => test.next());
           }
         }
-      };
+      });
       AddonManager.addAddonListener(listener);
       addon.uninstall();
 
       yield;
 
       mm.sendAsyncMessage("test687194:resolveChromeURI",
                           { URI: "chrome://bug687194/content/e10sbug.js" });
       lastResult = yield;