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

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

Issue 1968393002: Propogate network-worker thread split to api (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase including nits Created 4 years, 7 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/api/peerconnection_unittest.cc ('k') | webrtc/api/peerconnectionfactory.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 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } // namespace 43 } // namespace
44 44
45 class PeerConnectionEndToEndTest 45 class PeerConnectionEndToEndTest
46 : public sigslot::has_slots<>, 46 : public sigslot::has_slots<>,
47 public testing::Test { 47 public testing::Test {
48 public: 48 public:
49 typedef std::vector<rtc::scoped_refptr<DataChannelInterface> > 49 typedef std::vector<rtc::scoped_refptr<DataChannelInterface> >
50 DataChannelList; 50 DataChannelList;
51 51
52 PeerConnectionEndToEndTest() { 52 PeerConnectionEndToEndTest() {
53 RTC_CHECK(network_thread_.Start());
53 RTC_CHECK(worker_thread_.Start()); 54 RTC_CHECK(worker_thread_.Start());
54 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( 55 caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>(
55 "caller", &worker_thread_); 56 "caller", &network_thread_, &worker_thread_);
56 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>( 57 callee_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>(
57 "callee", &worker_thread_); 58 "callee", &network_thread_, &worker_thread_);
58 #ifdef WEBRTC_ANDROID 59 #ifdef WEBRTC_ANDROID
59 webrtc::InitializeAndroidObjects(); 60 webrtc::InitializeAndroidObjects();
60 #endif 61 #endif
61 } 62 }
62 63
63 void CreatePcs() { 64 void CreatePcs() {
64 CreatePcs(NULL); 65 CreatePcs(NULL);
65 } 66 }
66 67
67 void CreatePcs(const MediaConstraintsInterface* pc_constraints) { 68 void CreatePcs(const MediaConstraintsInterface* pc_constraints) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 const DataChannelList& remote_dc_list, 149 const DataChannelList& remote_dc_list,
149 size_t remote_dc_index) { 150 size_t remote_dc_index) {
150 local_dc->Close(); 151 local_dc->Close();
151 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, local_dc->state(), kMaxWait); 152 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, local_dc->state(), kMaxWait);
152 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, 153 EXPECT_EQ_WAIT(DataChannelInterface::kClosed,
153 remote_dc_list[remote_dc_index]->state(), 154 remote_dc_list[remote_dc_index]->state(),
154 kMaxWait); 155 kMaxWait);
155 } 156 }
156 157
157 protected: 158 protected:
159 rtc::Thread network_thread_;
158 rtc::Thread worker_thread_; 160 rtc::Thread worker_thread_;
159 rtc::scoped_refptr<PeerConnectionTestWrapper> caller_; 161 rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
160 rtc::scoped_refptr<PeerConnectionTestWrapper> callee_; 162 rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
161 DataChannelList caller_signaled_data_channels_; 163 DataChannelList caller_signaled_data_channels_;
162 DataChannelList callee_signaled_data_channels_; 164 DataChannelList callee_signaled_data_channels_;
163 }; 165 };
164 166
165 // Disabled for TSan v2, see 167 // Disabled for TSan v2, see
166 // https://bugs.chromium.org/p/webrtc/issues/detail?id=4719 for details. 168 // https://bugs.chromium.org/p/webrtc/issues/detail?id=4719 for details.
167 // Disabled for Mac, see 169 // Disabled for Mac, see
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0); 368 WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 0);
367 // This removes the reference to the remote data channel that we hold. 369 // This removes the reference to the remote data channel that we hold.
368 callee_signaled_data_channels_.clear(); 370 callee_signaled_data_channels_.clear();
369 caller_dc->Close(); 371 caller_dc->Close();
370 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); 372 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait);
371 373
372 // Wait for a bit longer so the remote data channel will receive the 374 // Wait for a bit longer so the remote data channel will receive the
373 // close message and be destroyed. 375 // close message and be destroyed.
374 rtc::Thread::Current()->ProcessMessages(100); 376 rtc::Thread::Current()->ProcessMessages(100);
375 } 377 }
OLDNEW
« no previous file with comments | « webrtc/api/peerconnection_unittest.cc ('k') | webrtc/api/peerconnectionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698