Bug 774368 - Calling removeMessageListener after test completes. r=smaug a=test-only
authorDoug Turner <dougt@dougt.org>
Thu, 06 Sep 2012 08:53:25 -0700
changeset 109345 999132c33e6d5c769c5c200f75d210866dd4a1c3
parent 109344 83b7dfe479177724b6c50a34572d6661f1edfd52
child 109346 b1356f418c94985109bf9a1d0c51eb00b4d292ca
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs774368
milestone17.0a2
Bug 774368 - Calling removeMessageListener after test completes. r=smaug a=test-only
dom/devicestorage/ipc/test_ipc.html
--- a/dom/devicestorage/ipc/test_ipc.html
+++ b/dom/devicestorage/ipc/test_ipc.html
@@ -66,16 +66,29 @@
           default:
             info(details);
         }
       }
     }
 
     function onTestComplete() {
       let comp = SpecialPowers.wrap(Components);
+      let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
+      let spObserver = comp.classes["@mozilla.org/special-powers-observer;1"]
+                            .getService(comp.interfaces.nsIMessageListener);
+
+      mm.removeMessageListener("SPPrefService", spObserver);
+      mm.removeMessageListener("SPProcessCrashService", spObserver);
+      mm.removeMessageListener("SPPingService", spObserver);
+      mm.removeMessageListener("SpecialPowers.Quit", spObserver);
+      mm.removeMessageListener("SPPermissionManager", spObserver);
+
+      mm.removeMessageListener("test:DeviceStorage:ipcTestMessage", onTestMessage);
+      mm.removeMessageListener("test:DeviceStorage:ipcTestComplete", onTestComplete);
+
       SimpleTest.executeSoon(function () { SimpleTest.finish(); });
     }
 
     function runTests() {
       let iframe = document.createElement("iframe");
       iframe.mozbrowser = true;
       iframe.id = "iframe";
       iframe.style.width = "100%";