Bug 837161: don't assert mainthread in AudioConduit create/init/destroy if in a unittest r=ehugg

This commit is contained in:
Randell Jesup 2013-02-01 13:28:38 -05:00
parent e85d930f66
commit ffe9e20dc5

View File

@ -27,7 +27,10 @@ const unsigned int WebrtcAudioConduit::CODEC_PLNAME_SIZE = 32;
mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create(AudioSessionConduit *aOther)
{
CSFLogDebug(logTag, "%s ", __FUNCTION__);
#ifdef MOZILLA_INTERNAL_API
// unit tests create their own "main thread"
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
#endif
WebrtcAudioConduit* obj = new WebrtcAudioConduit();
if(obj->Init(static_cast<WebrtcAudioConduit*>(aOther)) != kMediaConduitNoError)
@ -45,7 +48,10 @@ mozilla::RefPtr<AudioSessionConduit> AudioSessionConduit::Create(AudioSessionCon
*/
WebrtcAudioConduit::~WebrtcAudioConduit()
{
#ifdef MOZILLA_INTERNAL_API
// unit tests create their own "main thread"
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
#endif
CSFLogDebug(logTag, "%s ", __FUNCTION__);
for(std::vector<AudioCodecConfig*>::size_type i=0;i < mRecvCodecList.size();i++)