OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 // Borrowed from Chromium's src/base/threading/thread_checker_unittest.cc. | 11 // Borrowed from Chromium's src/base/threading/thread_checker_unittest.cc. |
12 | 12 |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "webrtc/base/checks.h" | 14 #include "webrtc/base/checks.h" |
15 #include "webrtc/base/thread.h" | 15 #include "webrtc/base/thread.h" |
16 #include "webrtc/base/thread_checker.h" | 16 #include "webrtc/base/thread_checker.h" |
17 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
18 #include "webrtc/test/testsupport/gtest_disable.h" | |
19 | 18 |
20 // Duplicated from base/threading/thread_checker.h so that we can be | 19 // Duplicated from base/threading/thread_checker.h so that we can be |
21 // good citizens there and undef the macro. | 20 // good citizens there and undef the macro. |
22 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) | 21 #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) |
23 #define ENABLE_THREAD_CHECKER 1 | 22 #define ENABLE_THREAD_CHECKER 1 |
24 #else | 23 #else |
25 #define ENABLE_THREAD_CHECKER 0 | 24 #define ENABLE_THREAD_CHECKER 0 |
26 #endif | 25 #endif |
27 | 26 |
28 namespace rtc { | 27 namespace rtc { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl(); | 189 ThreadCheckerClass::DetachThenCallFromDifferentThreadImpl(); |
191 } | 190 } |
192 #endif // ENABLE_THREAD_CHECKER | 191 #endif // ENABLE_THREAD_CHECKER |
193 | 192 |
194 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_THREAD_CHECKER | 193 #endif // GTEST_HAS_DEATH_TEST || !ENABLE_THREAD_CHECKER |
195 | 194 |
196 // Just in case we ever get lumped together with other compilation units. | 195 // Just in case we ever get lumped together with other compilation units. |
197 #undef ENABLE_THREAD_CHECKER | 196 #undef ENABLE_THREAD_CHECKER |
198 | 197 |
199 } // namespace rtc | 198 } // namespace rtc |
OLD | NEW |