Bug 1388372 - Fix assert and null check properly to account for the pass-through mode in gUM. r=jesup, a=lizzard
authorPaul Adenot <paul@paul.cx>
Wed, 09 Aug 2017 14:58:44 +0200
changeset 421138 220da0b3e32deaf135134938df6b51f55aff1c26
parent 421137 05d3c1eb0b02e8b9553ead543037614f0abc4911
child 421139 570ac5d020c8f43a0d1e8d9571236341b99e44e3
push id7608
push userryanvm@gmail.com
push dateMon, 14 Aug 2017 01:26:10 +0000
treeherdermozilla-beta@1ad3a57bcf6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lizzard
bugs1388372
milestone56.0
Bug 1388372 - Fix assert and null check properly to account for the pass-through mode in gUM. r=jesup, a=lizzard MozReview-Commit-ID: 9kFZG0LwKRM
dom/media/test/crashtests/1388372.html
dom/media/test/crashtests/crashtests.list
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
new file mode 100644
--- /dev/null
+++ b/dom/media/test/crashtests/1388372.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<script>
+navigator.mediaDevices.getUserMedia({audio: {
+    echoCancellation: false,
+    noiseSuppression: false,
+    autoGainControl: false
+  }, fake: true
+}).then((stream) => {
+    document.documentElement.removeAttribute("class");
+})
+</script>
+</html>
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -96,8 +96,9 @@ load doppler-1.html
 HTTP load media-element-source-seek-1.html
 load offline-buffer-source-ended-1.html
 load oscillator-ended-1.html
 load oscillator-ended-2.html
 skip-if(Android&&AndroidVersion=='22') load video-replay-after-audio-end.html # bug 1315125, bug 1358876
 # This needs to run at the end to avoid leaking busted state into other tests.
 load 691096-1.html
 load 1236639.html
+test-pref(media.navigator.permission.disabled,true) load 1388372.html
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -482,18 +482,19 @@ MediaEngineWebRTCMicrophoneSource::Start
     return NS_OK;
   }
   mState = kStarted;
   mTrackID = aID;
 
   // Make sure logger starts before capture
   AsyncLatencyLogger::Get(true);
 
-  MOZ_ASSERT(mAudioOutputObserver);
-  mAudioOutputObserver->Clear();
+  if (mAudioOutputObserver) {
+    mAudioOutputObserver->Clear();
+  }
 
   if (mVoEBase->StartReceive(mChannel)) {
     return NS_ERROR_FAILURE;
   }
 
   // Must be *before* StartSend() so it will notice we selected external input (full_duplex)
   mAudioInput->StartRecording(aStream, mListener);