Bug 1891332 - Replace debug MOZ_ASSERT with MOZ_RELEASE_ASSERT in webrtc/signaling tests. r=webrtc-reviewers,mjf

And MOZ_ASSERT(false) with MOZ_CRASH.

MOZ_ASSERT is only checked in debug builds, so release builds' tests are not checking these assertions.

Depends on D207376

Differential Revision: https://phabricator.services.mozilla.com/D207377
This commit is contained in:
Chris Peterson 2024-04-17 21:07:30 +00:00
parent 2985a83ebf
commit 6aba752b87
3 changed files with 10 additions and 10 deletions

View File

@ -17,7 +17,7 @@ void MockAudioSendStream::Reconfigure(const Config& config,
void MockAudioReceiveStream::SetDecoderMap(
std::map<int, webrtc::SdpAudioFormat> decoder_map) {
MOZ_ASSERT(mCallWrapper->GetMockCall()->mAudioReceiveConfig.isSome());
MOZ_RELEASE_ASSERT(mCallWrapper->GetMockCall()->mAudioReceiveConfig.isSome());
mCallWrapper->GetMockCall()->mAudioReceiveConfig->decoder_map =
std::move(decoder_map);
}

View File

@ -79,16 +79,16 @@ class MockAudioReceiveStream : public webrtc::AudioReceiveStreamInterface {
virtual void SetDepacketizerToDecoderFrameTransformer(
rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer)
override {
// Unimplemented after webrtc.org e2561e17e2 removed the Reconfigure
// method.
MOZ_ASSERT(false);
MOZ_CRASH(
"Unimplemented after webrtc.org e2561e17e2 removed the Reconfigure "
"method.");
}
virtual void SetDecoderMap(
std::map<int, webrtc::SdpAudioFormat> decoder_map) override;
virtual void SetNackHistory(int history_ms) override {
// Unimplemented after webrtc.org e2561e17e2 removed the Reconfigure
// method.
MOZ_ASSERT(false);
MOZ_CRASH(
"Unimplemented after webrtc.org e2561e17e2 removed the Reconfigure "
"method.");
}
virtual void SetNonSenderRttMeasurement(bool enabled) override {}
void SetFrameDecryptor(rtc::scoped_refptr<webrtc::FrameDecryptorInterface>

View File

@ -69,7 +69,7 @@ class FakeAudioTrack : public ProcessedMediaTrack {
void Destroy() override {
MutexAutoLock lock(mMutex);
MOZ_ASSERT(!mMainThreadDestroyed);
MOZ_RELEASE_ASSERT(!mMainThreadDestroyed);
mMainThreadDestroyed = true;
mTimer->Cancel();
mTimer = nullptr;
@ -79,14 +79,14 @@ class FakeAudioTrack : public ProcessedMediaTrack {
void AddListener(MediaTrackListener* aListener) override {
MutexAutoLock lock(mMutex);
MOZ_ASSERT(!mListener);
MOZ_RELEASE_ASSERT(!mListener);
mListener = aListener;
}
RefPtr<GenericPromise> RemoveListener(
MediaTrackListener* aListener) override {
MutexAutoLock lock(mMutex);
MOZ_ASSERT(mListener == aListener);
MOZ_RELEASE_ASSERT(mListener == aListener);
mListener = nullptr;
return GenericPromise::CreateAndResolve(true, __func__);
}