Bug 1291715 - Add pref for DTMF; r=jib,smaug
☠☠ backed out by 31d703eb5208 ☠ ☠
authorDan Minor <dminor@mozilla.com>
Tue, 20 Sep 2016 07:10:17 -0400
changeset 316539 078248a9fdbc3c28e09c57b65d4024f5b5c39c57
parent 316538 044172cb2dd83db60358793ee4e59063b0e96943
child 316540 31d703eb520875a72e955b8375352f507c575d3e
push id32865
push userdminor@mozilla.com
push dateWed, 05 Oct 2016 14:36:22 +0000
treeherderautoland@078248a9fdbc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, smaug
bugs1291715
milestone52.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 1291715 - Add pref for DTMF; r=jib,smaug MozReview-Commit-ID: Kl6xNKvif8K
dom/media/tests/mochitest/test_peerConnection_insertDTMF.html
dom/webidl/RTCRtpSender.webidl
modules/libpref/init/all.js
--- a/dom/media/tests/mochitest/test_peerConnection_insertDTMF.html
+++ b/dom/media/tests/mochitest/test_peerConnection_insertDTMF.html
@@ -53,30 +53,32 @@ function insertdtmftest(pc) {
   } catch (ex) {
     threw = true;
     is(ex.code, DOMException.INVALID_STATE_ERR, "Expected InvalidStateError");
   }
   ok(threw, "Expected exception");
 }
 
 runNetworkTest(() => {
-
   test = new PeerConnectionTest();
   test.setMediaConstraints([{audio: true}], [{audio: true}]);
   test.chain.removeAfter("PC_REMOTE_WAIT_FOR_MEDIA_FLOW");
 
   // Test sender dtmf.
   test.chain.append([
     function PC_LOCAL_INSERT_DTMF(test) {
       // We want to call removeTrack
       test.pcLocal.expectNegotiationNeeded();
       return insertdtmftest(test.pcLocal._pc);
     }
   ]);
 
-  return test.run()
+  var pushPrefs = (...p) => new Promise(r => SpecialPowers.pushPrefEnv({set: p}, r));
+
+  return pushPrefs(['media.peerconnection.dtmf.enabled', true])
+    .then(() => { test.run() })
     .catch(e => ok(false, "unexpected failure: " + e));
 });
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/webidl/RTCRtpSender.webidl
+++ b/dom/webidl/RTCRtpSender.webidl
@@ -68,10 +68,11 @@ dictionary RTCRtpParameters {
 
 [Pref="media.peerconnection.enabled",
  JSImplementation="@mozilla.org/dom/rtpsender;1"]
 interface RTCRtpSender {
   readonly attribute MediaStreamTrack track;
   Promise<void> setParameters (optional RTCRtpParameters parameters);
   RTCRtpParameters getParameters();
   Promise<void> replaceTrack(MediaStreamTrack track);
+  [Pref="media.peerconnection.dtmf.enabled"]
   readonly attribute RTCDTMFSender? dtmf;
 };
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -417,16 +417,18 @@ pref("media.navigator.load_adapt.high_lo
 pref("media.navigator.load_adapt.low_load","0.40");
 pref("media.navigator.video.default_fps",30);
 pref("media.navigator.video.default_minfps",10);
 pref("media.navigator.video.use_remb", true);
 pref("media.navigator.video.use_tmmbr", false);
 pref("media.navigator.audio.use_fec", true);
 pref("media.navigator.video.red_ulpfec_enabled", false);
 
+pref("media.peerconnection.dtmf.enabled", false);
+
 pref("media.webrtc.debug.trace_mask", 0);
 pref("media.webrtc.debug.multi_log", false);
 pref("media.webrtc.debug.aec_log_dir", "");
 pref("media.webrtc.debug.log_file", "");
 pref("media.webrtc.debug.aec_dump_max_size", 4194304); // 4MB
 
 #ifdef MOZ_WIDGET_GONK
 pref("media.navigator.video.default_width", 320);