OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2008 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Setting the network or worker thread while initialized should fail. | 95 // Setting the network or worker thread while initialized should fail. |
96 EXPECT_FALSE(cm_->set_network_thread(rtc::Thread::Current())); | 96 EXPECT_FALSE(cm_->set_network_thread(rtc::Thread::Current())); |
97 EXPECT_FALSE(cm_->set_worker_thread(rtc::Thread::Current())); | 97 EXPECT_FALSE(cm_->set_worker_thread(rtc::Thread::Current())); |
98 cm_->Terminate(); | 98 cm_->Terminate(); |
99 EXPECT_FALSE(cm_->initialized()); | 99 EXPECT_FALSE(cm_->initialized()); |
100 } | 100 } |
101 | 101 |
102 // Test that we can create and destroy a voice and video channel. | 102 // Test that we can create and destroy a voice and video channel. |
103 TEST_F(ChannelManagerTest, CreateDestroyChannels) { | 103 TEST_F(ChannelManagerTest, CreateDestroyChannels) { |
104 EXPECT_TRUE(cm_->Init()); | 104 EXPECT_TRUE(cm_->Init()); |
105 cricket::TransportChannel* rtp_transport = | 105 cricket::DtlsTransportInternal* rtp_transport = |
106 transport_controller_->CreateTransportChannel( | 106 transport_controller_->CreateDtlsTransport( |
107 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); | 107 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); |
108 cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel( | 108 cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel( |
109 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, | 109 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, |
110 rtc::Thread::Current(), cricket::CN_AUDIO, nullptr, | 110 rtc::Thread::Current(), cricket::CN_AUDIO, nullptr, |
111 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions()); | 111 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions()); |
112 EXPECT_TRUE(voice_channel != nullptr); | 112 EXPECT_TRUE(voice_channel != nullptr); |
113 cricket::VideoChannel* video_channel = cm_->CreateVideoChannel( | 113 cricket::VideoChannel* video_channel = cm_->CreateVideoChannel( |
114 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, | 114 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, |
115 rtc::Thread::Current(), cricket::CN_VIDEO, nullptr, | 115 rtc::Thread::Current(), cricket::CN_VIDEO, nullptr, |
116 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions()); | 116 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions()); |
(...skipping 12 matching lines...) Expand all Loading... |
129 // Test that we can create and destroy a voice and video channel with a worker. | 129 // Test that we can create and destroy a voice and video channel with a worker. |
130 TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) { | 130 TEST_F(ChannelManagerTest, CreateDestroyChannelsOnThread) { |
131 network_.Start(); | 131 network_.Start(); |
132 worker_.Start(); | 132 worker_.Start(); |
133 EXPECT_TRUE(cm_->set_worker_thread(&worker_)); | 133 EXPECT_TRUE(cm_->set_worker_thread(&worker_)); |
134 EXPECT_TRUE(cm_->set_network_thread(&network_)); | 134 EXPECT_TRUE(cm_->set_network_thread(&network_)); |
135 EXPECT_TRUE(cm_->Init()); | 135 EXPECT_TRUE(cm_->Init()); |
136 delete transport_controller_; | 136 delete transport_controller_; |
137 transport_controller_ = | 137 transport_controller_ = |
138 new cricket::FakeTransportController(&network_, ICEROLE_CONTROLLING); | 138 new cricket::FakeTransportController(&network_, ICEROLE_CONTROLLING); |
139 cricket::TransportChannel* rtp_transport = | 139 cricket::DtlsTransportInternal* rtp_transport = |
140 transport_controller_->CreateTransportChannel( | 140 transport_controller_->CreateDtlsTransport( |
141 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); | 141 cricket::CN_AUDIO, cricket::ICE_CANDIDATE_COMPONENT_RTP); |
142 cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel( | 142 cricket::VoiceChannel* voice_channel = cm_->CreateVoiceChannel( |
143 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, | 143 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, |
144 rtc::Thread::Current(), cricket::CN_AUDIO, nullptr, | 144 rtc::Thread::Current(), cricket::CN_AUDIO, nullptr, |
145 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions()); | 145 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, AudioOptions()); |
146 EXPECT_TRUE(voice_channel != nullptr); | 146 EXPECT_TRUE(voice_channel != nullptr); |
147 cricket::VideoChannel* video_channel = cm_->CreateVideoChannel( | 147 cricket::VideoChannel* video_channel = cm_->CreateVideoChannel( |
148 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, | 148 &fake_mc_, rtp_transport, nullptr /*rtcp_transport*/, |
149 rtc::Thread::Current(), cricket::CN_VIDEO, nullptr, | 149 rtc::Thread::Current(), cricket::CN_VIDEO, nullptr, |
150 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions()); | 150 kDefaultRtcpMuxRequired, kDefaultSrtpRequired, VideoOptions()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); | 184 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); |
185 | 185 |
186 // Can set again after terminate. | 186 // Can set again after terminate. |
187 cm_->Terminate(); | 187 cm_->Terminate(); |
188 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); | 188 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); |
189 cm_->GetSupportedVideoCodecs(&codecs); | 189 cm_->GetSupportedVideoCodecs(&codecs); |
190 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); | 190 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); |
191 } | 191 } |
192 | 192 |
193 } // namespace cricket | 193 } // namespace cricket |
OLD | NEW |