OLD | NEW |
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 "callee", &network_thread_, &worker_thread_); | 52 "callee", &network_thread_, &worker_thread_); |
53 webrtc::PeerConnectionInterface::IceServer ice_server; | 53 webrtc::PeerConnectionInterface::IceServer ice_server; |
54 ice_server.uri = "stun:stun.l.google.com:19302"; | 54 ice_server.uri = "stun:stun.l.google.com:19302"; |
55 config_.servers.push_back(ice_server); | 55 config_.servers.push_back(ice_server); |
56 | 56 |
57 #ifdef WEBRTC_ANDROID | 57 #ifdef WEBRTC_ANDROID |
58 webrtc::InitializeAndroidObjects(); | 58 webrtc::InitializeAndroidObjects(); |
59 #endif | 59 #endif |
60 } | 60 } |
61 | 61 |
62 void CreatePcs() { | 62 void CreatePcs() { CreatePcs(nullptr); } |
63 CreatePcs(NULL); | |
64 } | |
65 | 63 |
66 void CreatePcs(const MediaConstraintsInterface* pc_constraints) { | 64 void CreatePcs(const MediaConstraintsInterface* pc_constraints) { |
67 EXPECT_TRUE(caller_->CreatePc(pc_constraints, config_)); | 65 EXPECT_TRUE(caller_->CreatePc(pc_constraints, config_)); |
68 EXPECT_TRUE(callee_->CreatePc(pc_constraints, config_)); | 66 EXPECT_TRUE(callee_->CreatePc(pc_constraints, config_)); |
69 PeerConnectionTestWrapper::Connect(caller_.get(), callee_.get()); | 67 PeerConnectionTestWrapper::Connect(caller_.get(), callee_.get()); |
70 | 68 |
71 caller_->SignalOnDataChannel.connect( | 69 caller_->SignalOnDataChannel.connect( |
72 this, &PeerConnectionEndToEndTest::OnCallerAddedDataChanel); | 70 this, &PeerConnectionEndToEndTest::OnCallerAddedDataChanel); |
73 callee_->SignalOnDataChannel.connect( | 71 callee_->SignalOnDataChannel.connect( |
74 this, &PeerConnectionEndToEndTest::OnCalleeAddedDataChannel); | 72 this, &PeerConnectionEndToEndTest::OnCalleeAddedDataChannel); |
75 } | 73 } |
76 | 74 |
77 void GetAndAddUserMedia() { | 75 void GetAndAddUserMedia() { |
78 FakeConstraints audio_constraints; | 76 FakeConstraints audio_constraints; |
79 FakeConstraints video_constraints; | 77 FakeConstraints video_constraints; |
80 GetAndAddUserMedia(true, audio_constraints, true, video_constraints); | 78 GetAndAddUserMedia(true, audio_constraints, true, video_constraints); |
81 } | 79 } |
82 | 80 |
83 void GetAndAddUserMedia(bool audio, FakeConstraints audio_constraints, | 81 void GetAndAddUserMedia(bool audio, FakeConstraints audio_constraints, |
84 bool video, FakeConstraints video_constraints) { | 82 bool video, FakeConstraints video_constraints) { |
85 caller_->GetAndAddUserMedia(audio, audio_constraints, | 83 caller_->GetAndAddUserMedia(audio, audio_constraints, |
86 video, video_constraints); | 84 video, video_constraints); |
87 callee_->GetAndAddUserMedia(audio, audio_constraints, | 85 callee_->GetAndAddUserMedia(audio, audio_constraints, |
88 video, video_constraints); | 86 video, video_constraints); |
89 } | 87 } |
90 | 88 |
91 void Negotiate() { | 89 void Negotiate() { caller_->CreateOffer(nullptr); } |
92 caller_->CreateOffer(NULL); | |
93 } | |
94 | 90 |
95 void WaitForCallEstablished() { | 91 void WaitForCallEstablished() { |
96 caller_->WaitForCallEstablished(); | 92 caller_->WaitForCallEstablished(); |
97 callee_->WaitForCallEstablished(); | 93 callee_->WaitForCallEstablished(); |
98 } | 94 } |
99 | 95 |
100 void WaitForConnection() { | 96 void WaitForConnection() { |
101 caller_->WaitForConnection(); | 97 caller_->WaitForConnection(); |
102 callee_->WaitForConnection(); | 98 callee_->WaitForConnection(); |
103 } | 99 } |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 // This removes the reference to the remote data channel that we hold. | 430 // This removes the reference to the remote data channel that we hold. |
435 callee_signaled_data_channels_.clear(); | 431 callee_signaled_data_channels_.clear(); |
436 caller_dc->Close(); | 432 caller_dc->Close(); |
437 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); | 433 EXPECT_EQ_WAIT(DataChannelInterface::kClosed, caller_dc->state(), kMaxWait); |
438 | 434 |
439 // Wait for a bit longer so the remote data channel will receive the | 435 // Wait for a bit longer so the remote data channel will receive the |
440 // close message and be destroyed. | 436 // close message and be destroyed. |
441 rtc::Thread::Current()->ProcessMessages(100); | 437 rtc::Thread::Current()->ProcessMessages(100); |
442 } | 438 } |
443 #endif // HAVE_SCTP | 439 #endif // HAVE_SCTP |
OLD | NEW |