Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: webrtc/base/sequenced_task_checker_unittest.cc

Issue 2389943003: Test RTC_DCHECK_IS_ON instead of checking DCHECK_ALWAYS_ON everywhere (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/sequenced_task_checker.h ('k') | webrtc/base/stringutils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 new SequencedTaskChecker()); 191 new SequencedTaskChecker());
192 192
193 sequenced_task_checker->Detach(); 193 sequenced_task_checker->Detach();
194 CallCalledSequentiallyOnThread call_on_thread(true, 194 CallCalledSequentiallyOnThread call_on_thread(true,
195 sequenced_task_checker.get()); 195 sequenced_task_checker.get());
196 done_event.Set(); 196 done_event.Set();
197 }); 197 });
198 EXPECT_TRUE(done_event.Wait(1000)); 198 EXPECT_TRUE(done_event.Wait(1000));
199 } 199 }
200 200
201 #if !defined(NDEBUG) || DCHECK_ALWAYS_ON 201 #if RTC_DCHECK_IS_ON
202 TEST(SequencedTaskCheckerTest, MethodNotAllowedOnDifferentThreadInDebug) { 202 TEST(SequencedTaskCheckerTest, MethodNotAllowedOnDifferentThreadInDebug) {
203 RunMethodOnDifferentThread(false); 203 RunMethodOnDifferentThread(false);
204 } 204 }
205 #else 205 #else
206 TEST(SequencedTaskCheckerTest, MethodAllowedOnDifferentThreadInRelease) { 206 TEST(SequencedTaskCheckerTest, MethodAllowedOnDifferentThreadInRelease) {
207 RunMethodOnDifferentThread(true); 207 RunMethodOnDifferentThread(true);
208 } 208 }
209 #endif 209 #endif
210 210
211 #if !defined(NDEBUG) || DCHECK_ALWAYS_ON 211 #if RTC_DCHECK_IS_ON
212 TEST(SequencedTaskCheckerTest, MethodNotAllowedOnDifferentTaskQueueInDebug) { 212 TEST(SequencedTaskCheckerTest, MethodNotAllowedOnDifferentTaskQueueInDebug) {
213 RunMethodOnDifferentTaskQueue(false); 213 RunMethodOnDifferentTaskQueue(false);
214 } 214 }
215 #else 215 #else
216 TEST(SequencedTaskCheckerTest, MethodAllowedOnDifferentTaskQueueInRelease) { 216 TEST(SequencedTaskCheckerTest, MethodAllowedOnDifferentTaskQueueInRelease) {
217 RunMethodOnDifferentTaskQueue(true); 217 RunMethodOnDifferentTaskQueue(true);
218 } 218 }
219 #endif 219 #endif
220 220
221 #if !defined(NDEBUG) || DCHECK_ALWAYS_ON 221 #if RTC_DCHECK_IS_ON
222 TEST(SequencedTaskCheckerTest, DetachFromTaskQueueInDebug) { 222 TEST(SequencedTaskCheckerTest, DetachFromTaskQueueInDebug) {
223 DetachThenCallFromDifferentTaskQueue(false); 223 DetachThenCallFromDifferentTaskQueue(false);
224 } 224 }
225 #else 225 #else
226 TEST(SequencedTaskCheckerTest, DetachFromTaskQueueInRelease) { 226 TEST(SequencedTaskCheckerTest, DetachFromTaskQueueInRelease) {
227 DetachThenCallFromDifferentTaskQueue(true); 227 DetachThenCallFromDifferentTaskQueue(true);
228 } 228 }
229 #endif 229 #endif
230 230
231 class TestAnnotations { 231 class TestAnnotations {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueDebug) { 265 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueDebug) {
266 ASSERT_DEATH({ TestAnnotationsOnWrongQueue(); }, ""); 266 ASSERT_DEATH({ TestAnnotationsOnWrongQueue(); }, "");
267 } 267 }
268 #else 268 #else
269 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueRelease) { 269 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueRelease) {
270 TestAnnotationsOnWrongQueue(); 270 TestAnnotationsOnWrongQueue();
271 } 271 }
272 #endif 272 #endif
273 #endif // GTEST_HAS_DEATH_TEST 273 #endif // GTEST_HAS_DEATH_TEST
274 } // namespace rtc 274 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/sequenced_task_checker.h ('k') | webrtc/base/stringutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698