Disable tests for TSan v2

These are tests that fail and that I haven't been able to suppress.
I assume they're caused by the same bug in TSan v2 as described in
webrtc:2259.

BUG=2259,2334
TEST=Ran the tests similar to the instructions in the bugs, passed 100 iterations.
R=andrew@webrtc.org, hta@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2250004

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4787 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/system_wrappers/source/thread_unittest.cc b/system_wrappers/source/thread_unittest.cc
index 25095e6..d37f45b 100644
--- a/system_wrappers/source/thread_unittest.cc
+++ b/system_wrappers/source/thread_unittest.cc
@@ -20,6 +20,10 @@
   return true;
 }
 
+// Disable for TSan v2, see
+// https://code.google.com/p/webrtc/issues/detail?id=2259 for details.
+#if !defined(THREAD_SANITIZER)
+
 TEST(ThreadTest, StartStop) {
   ThreadWrapper* thread = ThreadWrapper::CreateThread(&NullRunFunction, NULL);
   unsigned int id = 42;
@@ -50,4 +54,6 @@
   delete thread;
 }
 
+#endif // if !defined(THREAD_SANITIZER)
+
 }  // namespace webrtc
diff --git a/test/channel_transport/udp_socket_manager_unittest.cc b/test/channel_transport/udp_socket_manager_unittest.cc
index d8e66b9..eccd8ea 100644
--- a/test/channel_transport/udp_socket_manager_unittest.cc
+++ b/test/channel_transport/udp_socket_manager_unittest.cc
@@ -23,6 +23,10 @@
 namespace webrtc {
 namespace test {
 
+// Disable for TSan v2, see
+// https://code.google.com/p/webrtc/issues/detail?id=2334 for details.
+#if !defined(THREAD_SANITIZER)
+
 TEST(UdpSocketManager, CreateCallsInitAndDoesNotLeakMemory) {
   int32_t id = 42;
   uint8_t threads = 1;
@@ -80,5 +84,7 @@
 #endif
 }
 
+#endif // if !defined(THREAD_SANITIZER)
+
 }  // namespace test
 }  // namespace webrtc
diff --git a/test/channel_transport/udp_transport_unittest.cc b/test/channel_transport/udp_transport_unittest.cc
index 5ccc9ef..8ed204a 100644
--- a/test/channel_transport/udp_transport_unittest.cc
+++ b/test/channel_transport/udp_transport_unittest.cc
@@ -108,6 +108,10 @@
   std::vector<MockUdpSocketWrapper*> sockets_created_;
 };
 
+// Disable for TSan v2, see
+// https://code.google.com/p/webrtc/issues/detail?id=2334 for details.
+#if !defined(THREAD_SANITIZER)
+
 TEST_F(UDPTransportTest, CreateTransport) {
   int32_t id = 0;
   uint8_t threads = 1;
@@ -115,6 +119,8 @@
   UdpTransport::Destroy(transport);
 }
 
+#endif // if !defined(THREAD_SANITIZER)
+
 // This test verifies that the mock_socket is not called from the constructor.
 TEST_F(UDPTransportTest, ConstructorDoesNotCreateSocket) {
   int32_t id = 0;