Bug 1332608 - Fix JavaScript error in webrtcUI.jsm: nsIMessageListenerManager.removeMessageListener: Not enough arguments; r=florian a=gchang
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Mon, 23 Jan 2017 15:22:30 +0800
changeset 375666 7261f391ff4fb2287a7a8530d9319eccb378e510
parent 375665 f78767560dc26c97d0e35c3ab6c36fec078d875a
child 375667 542fb35b78c88923c9582c6be24db90fd59702fd
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, gchang
bugs1332608
milestone53.0a2
Bug 1332608 - Fix JavaScript error in webrtcUI.jsm: nsIMessageListenerManager.removeMessageListener: Not enough arguments; r=florian a=gchang MozReview-Commit-ID: LHzfrUpFGVy
browser/base/content/test/webrtc/browser_devices_get_user_media.js
browser/modules/webrtcUI.jsm
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media.js
@@ -562,16 +562,24 @@ var gTests = [
     ok(notification.button.disabled, "Allow button is disabled");
     ok(!notification.hasAttribute("warninghidden"), "warning message is shown");
 
     // Cleanup.
     yield closeStream(true);
     Perms.remove(uri, "camera");
     Perms.remove(uri, "microphone");
   }
+},
+
+{
+  desc: "getUserMedia init & uninit",
+  run: function* checkInitAndUninit() {
+    webrtcUI.uninit();
+    webrtcUI.init();
+  }
 }
 
 ];
 
 function test() {
   waitForExplicitFinish();
 
   let tab = gBrowser.addTab();
--- a/browser/modules/webrtcUI.jsm
+++ b/browser/modules/webrtcUI.jsm
@@ -58,17 +58,17 @@ this.webrtcUI = {
     ppmm.removeMessageListener("webrtc:UpdatingIndicators", this);
     ppmm.removeMessageListener("webrtc:UpdateGlobalIndicators", this);
 
     let mm = Cc["@mozilla.org/globalmessagemanager;1"]
                .getService(Ci.nsIMessageListenerManager);
     mm.removeMessageListener("rtcpeer:Request", this);
     mm.removeMessageListener("rtcpeer:CancelRequest", this);
     mm.removeMessageListener("webrtc:Request", this);
-    mm.removeMessageListener("webrtc:StopRecording");
+    mm.removeMessageListener("webrtc:StopRecording", this);
     mm.removeMessageListener("webrtc:CancelRequest", this);
     mm.removeMessageListener("webrtc:UpdateBrowserIndicators", this);
 
     if (gIndicatorWindow) {
       gIndicatorWindow.close();
       gIndicatorWindow = null;
     }
   },