Bug 799246: Conditionally enable webrtc unit tests r=jesup,ted,cjones
authorEKR <ekr@rtfm.com>
Mon, 08 Oct 2012 18:56:00 -0700
changeset 109868 ec34a79837f61c5f501a3883d503cb5dbd908c54
parent 109867 6a38038d6c587391498b5bf07db128916f0c8034
child 109869 c0b4572696b64295fdfc72c9d61e9e76290bddd6
push id84
push usernmatsakis@mozilla.com
push dateThu, 11 Oct 2012 23:26:24 +0000
reviewersjesup, ted, cjones
bugs799246
milestone19.0a1
Bug 799246: Conditionally enable webrtc unit tests r=jesup,ted,cjones
configure.in
ipc/chromium/src/base/logging.h
media/webrtc/signaling/test/mediapipeline_unittest.cpp
toolkit/toolkit-tiers.mk
--- a/configure.in
+++ b/configure.in
@@ -5259,16 +5259,17 @@ dnl enable once PeerConnection lands
     AC_DEFINE(MOZ_PEERCONNECTION)
     MOZ_SCTP=1
     MOZ_SRTP=1
     AC_DEFINE(MOZ_SCTP)
     AC_DEFINE(MOZ_SRTP)
 fi
 
 AC_SUBST(MOZ_WEBRTC)
+AC_SUBST(MOZ_WEBRTC_TESTS)
 AC_SUBST(MOZ_WEBRTC_SIGNALING)
 AC_SUBST(MOZ_PEERCONNECTION)
 AC_SUBST(MOZ_WEBRTC_IN_LIBXUL)
 AC_SUBST(MOZ_SCTP)
 AC_SUBST(MOZ_SRTP)
 
 case "$target_cpu" in
 arm*)
--- a/ipc/chromium/src/base/logging.h
+++ b/ipc/chromium/src/base/logging.h
@@ -6,16 +6,20 @@
 #define BASE_LOGGING_H_
 
 #include <string>
 #include <cstring>
 
 #include "base/basictypes.h"
 #include "prlog.h"
 
+#ifdef NO_CHROMIUM_LOGGING
+#include <sstream>
+#endif
+
 // Replace the Chromium logging code with NSPR-based logging code and
 // some C++ wrappers to emulate std::ostream
 
 namespace mozilla {
 
 enum LogSeverity {
   LOG_INFO,
   LOG_WARNING,
@@ -79,19 +83,25 @@ mozilla::Logger& operator<<(mozilla::Log
 mozilla::Logger& operator<<(mozilla::Logger& log, void* p);
 
 template<class T>
 const mozilla::EmptyLog& operator <<(const mozilla::EmptyLog& log, const T&)
 {
   return log;
 }
 
+#ifdef NO_CHROMIUM_LOGGING
+#define LOG(info) std::stringstream()
+#define LOG_IF(info, condition) if (!(condition)) std::stringstream()
+#else
 #define LOG(info) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
 #define LOG_IF(info, condition) \
   if (!(condition)) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
+#endif
+
 
 #ifdef DEBUG
 #define DLOG(info) LOG(info)
 #define DLOG_IF(info) LOG_IF(info)
 #define DCHECK(condition) CHECK(condition)
 #else
 #define DLOG(info) mozilla::EmptyLog()
 #define DLOG_IF(info, condition) mozilla::EmptyLog()
--- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp
@@ -5,16 +5,17 @@
 // Original author: ekr@rtfm.com
 
 #include <iostream>
 
 #include "sigslot.h"
 
 #include "nsThreadUtils.h"
 #include "nsXPCOM.h"
+#include "nss.h"
 #include "ssl.h"
 #include "sslproto.h"
 
 #include "dtlsidentity.h"
 #include "logging.h"
 #include "mozilla/RefPtr.h"
 #include "FakeMediaStreams.h"
 #include "FakeMediaStreamsImpl.h"
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -287,13 +287,14 @@ endif
 
 ifdef ENABLE_TESTS
 tier_platform_dirs += testing/mochitest
 tier_platform_dirs += testing/xpcshell
 tier_platform_dirs += testing/tools/screenshot
 tier_platform_dirs += testing/peptest
 tier_platform_dirs += testing/mozbase
 ifdef MOZ_WEBRTC
-#disabled
-#tier_platform_dirs += media/webrtc/signaling/test
-#tier_platform_dirs += media/mtransport/test
+ifdef MOZ_WEBRTC_TESTS
+tier_platform_dirs += media/webrtc/signaling/test
+tier_platform_dirs += media/mtransport/test
 endif
 endif
+endif