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

Side by Side Diff: webrtc/rtc_base/physicalsocketserver_unittest.cc

Issue 2979963002: Revert of Make the default ctor of rtc::Thread, protected (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 TEST_F(PosixSignalDeliveryTest, SignalOnDifferentThread) { 603 TEST_F(PosixSignalDeliveryTest, SignalOnDifferentThread) {
604 ss_->SetPosixSignalHandler(SIGTERM, &RecordSignal); 604 ss_->SetPosixSignalHandler(SIGTERM, &RecordSignal);
605 // Mask out SIGTERM so that it can't be delivered to this thread. 605 // Mask out SIGTERM so that it can't be delivered to this thread.
606 sigset_t mask; 606 sigset_t mask;
607 sigemptyset(&mask); 607 sigemptyset(&mask);
608 sigaddset(&mask, SIGTERM); 608 sigaddset(&mask, SIGTERM);
609 EXPECT_EQ(0, pthread_sigmask(SIG_SETMASK, &mask, nullptr)); 609 EXPECT_EQ(0, pthread_sigmask(SIG_SETMASK, &mask, nullptr));
610 // Start a new thread that raises it. It will have to be delivered to that 610 // Start a new thread that raises it. It will have to be delivered to that
611 // thread. Our implementation should safely handle it and dispatch 611 // thread. Our implementation should safely handle it and dispatch
612 // RecordSignal() on this thread. 612 // RecordSignal() on this thread.
613 std::unique_ptr<Thread> thread(Thread::CreateWithSocketServer()); 613 std::unique_ptr<Thread> thread(new Thread());
614 std::unique_ptr<RaiseSigTermRunnable> runnable(new RaiseSigTermRunnable()); 614 std::unique_ptr<RaiseSigTermRunnable> runnable(new RaiseSigTermRunnable());
615 thread->Start(runnable.get()); 615 thread->Start(runnable.get());
616 EXPECT_TRUE(ss_->Wait(1500, true)); 616 EXPECT_TRUE(ss_->Wait(1500, true));
617 EXPECT_TRUE(ExpectSignal(SIGTERM)); 617 EXPECT_TRUE(ExpectSignal(SIGTERM));
618 EXPECT_EQ(Thread::Current(), signaled_thread_); 618 EXPECT_EQ(Thread::Current(), signaled_thread_);
619 EXPECT_TRUE(ExpectNone()); 619 EXPECT_TRUE(ExpectNone());
620 } 620 }
621 621
622 #endif 622 #endif
623 623
624 } // namespace rtc 624 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/rtc_base/nullsocketserver_unittest.cc ('k') | webrtc/rtc_base/rtccertificategenerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698