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

Side by Side Diff: webrtc/pc/peerconnectionendtoend_unittest.cc

Issue 2977953002: Partial Reland of Make the default ctor of rtc::Thread, protected (Closed)
Patch Set: Fix the same error elsewhere 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
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | webrtc/pc/peerconnectioninterface_unittest.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 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } // namespace 47 } // namespace
48 48
49 class PeerConnectionEndToEndTest 49 class PeerConnectionEndToEndTest
50 : public sigslot::has_slots<>, 50 : public sigslot::has_slots<>,
51 public testing::Test { 51 public testing::Test {
52 public: 52 public:
53 typedef std::vector<rtc::scoped_refptr<DataChannelInterface> > 53 typedef std::vector<rtc::scoped_refptr<DataChannelInterface> >
54 DataChannelList; 54 DataChannelList;
55 55
56 PeerConnectionEndToEndTest() { 56 PeerConnectionEndToEndTest() {
57 RTC_CHECK(network_thread_.Start()); 57 network_thread_ = rtc::Thread::CreateWithSocketServer();
58 RTC_CHECK(worker_thread_.Start()); 58 worker_thread_ = rtc::Thread::Create();
59 RTC_CHECK(network_thread_->Start());
60 RTC_CHECK(worker_thread_->Start());
59 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( 61 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>(
60 "caller", &network_thread_, &worker_thread_); 62 "caller", network_thread_.get(), worker_thread_.get());
61 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( 63 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>(
62 "callee", &network_thread_, &worker_thread_); 64 "callee", network_thread_.get(), worker_thread_.get());
63 webrtc::PeerConnectionInterface::IceServer ice_server; 65 webrtc::PeerConnectionInterface::IceServer ice_server;
64 ice_server.uri = "stun:stun.l.google.com:19302"; 66 ice_server.uri = "stun:stun.l.google.com:19302";
65 config_.servers.push_back(ice_server); 67 config_.servers.push_back(ice_server);
66 68
67 #ifdef WEBRTC_ANDROID 69 #ifdef WEBRTC_ANDROID
68 webrtc::InitializeAndroidObjects(); 70 webrtc::InitializeAndroidObjects();
69 #endif 71 #endif
70 } 72 }
71 73
72 void CreatePcs( 74 void CreatePcs(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const DataChannelList& remote_dc_list, 160 const DataChannelList& remote_dc_list,
159 size_t remote_dc_index) { 161 size_t remote_dc_index) {
160 local_dc->Close(); 162 local_dc->Close();
161 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, local_dc->state(), kMaxWait); 163 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, local_dc->state(), kMaxWait);
162 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, 164 EXPECT_EQ_WAIT(DataChannelInterface::kClosed,
163 remote_dc_list[remote_dc_index]->state(), 165 remote_dc_list[remote_dc_index]->state(),
164 kMaxWait); 166 kMaxWait);
165 } 167 }
166 168
167 protected: 169 protected:
168 rtc::Thread network_thread_; 170 std::unique_ptr<rtc::Thread> network_thread_;
169 rtc::Thread worker_thread_; 171 std::unique_ptr<rtc::Thread> worker_thread_;
170 rtc::scoped_refptr<PeerConnectionTestWrapper> caller_; 172 rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
171 rtc::scoped_refptr<PeerConnectionTestWrapper> callee_; 173 rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
172 DataChannelList caller_signaled_data_channels_; 174 DataChannelList caller_signaled_data_channels_;
173 DataChannelList callee_signaled_data_channels_; 175 DataChannelList callee_signaled_data_channels_;
174 webrtc::PeerConnectionInterface::RTCConfiguration config_; 176 webrtc::PeerConnectionInterface::RTCConfiguration config_;
175 }; 177 };
176 178
177 std::unique_ptr<webrtc::AudioDecoder> CreateForwardingMockDecoder( 179 std::unique_ptr<webrtc::AudioDecoder> CreateForwardingMockDecoder(
178 std::unique_ptr<webrtc::AudioDecoder> real_decoder) { 180 std::unique_ptr<webrtc::AudioDecoder> real_decoder) {
179 class ForwardingMockDecoder : public StrictMock<webrtc::MockAudioDecoder> { 181 class ForwardingMockDecoder : public StrictMock<webrtc::MockAudioDecoder> {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // This removes the reference to the remote data channel that we hold. 540 // This removes the reference to the remote data channel that we hold.
539 callee_signaled_data_channels_.clear(); 541 callee_signaled_data_channels_.clear();
540 caller_dc->Close(); 542 caller_dc->Close();
541 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); 543 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait);
542 544
543 // Wait for a bit longer so the remote data channel will receive the 545 // Wait for a bit longer so the remote data channel will receive the
544 // close message and be destroyed. 546 // close message and be destroyed.
545 rtc::Thread::Current()->ProcessMessages(100); 547 rtc::Thread::Current()->ProcessMessages(100);
546 } 548 }
547 #endif // HAVE_SCTP 549 #endif // HAVE_SCTP
OLDNEW
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | webrtc/pc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698