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

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

Issue 2708723003: Introduce new constructor to PlatformThread. (Closed)
Patch Set: Disable RTC_DCHECK in channel_proxy + add TODO Created 3 years, 10 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/rate_limiter_unittest.cc ('k') | webrtc/base/task_queue.h » ('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 17 matching lines...) Expand all
28 thread_(&Run, this, "call_do_stuff_on_thread"), 28 thread_(&Run, this, "call_do_stuff_on_thread"),
29 sequenced_task_checker_(sequenced_task_checker) { 29 sequenced_task_checker_(sequenced_task_checker) {
30 thread_.Start(); 30 thread_.Start();
31 } 31 }
32 ~CallCalledSequentiallyOnThread() { 32 ~CallCalledSequentiallyOnThread() {
33 EXPECT_TRUE(thread_has_run_event_.Wait(1000)); 33 EXPECT_TRUE(thread_has_run_event_.Wait(1000));
34 thread_.Stop(); 34 thread_.Stop();
35 } 35 }
36 36
37 private: 37 private:
38 static bool Run(void* obj) { 38 static void Run(void* obj) {
39 CallCalledSequentiallyOnThread* call_stuff_on_thread = 39 CallCalledSequentiallyOnThread* call_stuff_on_thread =
40 static_cast<CallCalledSequentiallyOnThread*>(obj); 40 static_cast<CallCalledSequentiallyOnThread*>(obj);
41 EXPECT_EQ( 41 EXPECT_EQ(
42 call_stuff_on_thread->expect_true_, 42 call_stuff_on_thread->expect_true_,
43 call_stuff_on_thread->sequenced_task_checker_->CalledSequentially()); 43 call_stuff_on_thread->sequenced_task_checker_->CalledSequentially());
44 call_stuff_on_thread->thread_has_run_event_.Set(); 44 call_stuff_on_thread->thread_has_run_event_.Set();
45 return false;
46 } 45 }
47 46
48 const bool expect_true_; 47 const bool expect_true_;
49 Event thread_has_run_event_; 48 Event thread_has_run_event_;
50 PlatformThread thread_; 49 PlatformThread thread_;
51 SequencedTaskChecker* const sequenced_task_checker_; 50 SequencedTaskChecker* const sequenced_task_checker_;
52 51
53 RTC_DISALLOW_COPY_AND_ASSIGN(CallCalledSequentiallyOnThread); 52 RTC_DISALLOW_COPY_AND_ASSIGN(CallCalledSequentiallyOnThread);
54 }; 53 };
55 54
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueDebug) { 264 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueDebug) {
266 ASSERT_DEATH({ TestAnnotationsOnWrongQueue(); }, ""); 265 ASSERT_DEATH({ TestAnnotationsOnWrongQueue(); }, "");
267 } 266 }
268 #else 267 #else
269 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueRelease) { 268 TEST(SequencedTaskCheckerTest, TestAnnotationsOnWrongQueueRelease) {
270 TestAnnotationsOnWrongQueue(); 269 TestAnnotationsOnWrongQueue();
271 } 270 }
272 #endif 271 #endif
273 #endif // GTEST_HAS_DEATH_TEST 272 #endif // GTEST_HAS_DEATH_TEST
274 } // namespace rtc 273 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/base/rate_limiter_unittest.cc ('k') | webrtc/base/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698