OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 |
| 11 #include <memory> |
| 12 |
11 #include "webrtc/base/fakesslidentity.h" | 13 #include "webrtc/base/fakesslidentity.h" |
12 #include "webrtc/base/gunit.h" | 14 #include "webrtc/base/gunit.h" |
13 #include "webrtc/base/network.h" | 15 #include "webrtc/base/network.h" |
14 #include "webrtc/p2p/base/faketransportcontroller.h" | 16 #include "webrtc/p2p/base/faketransportcontroller.h" |
15 #include "webrtc/p2p/base/p2ptransport.h" | 17 #include "webrtc/p2p/base/p2ptransport.h" |
16 | 18 |
17 using cricket::Transport; | 19 using cricket::Transport; |
18 using cricket::FakeTransport; | 20 using cricket::FakeTransport; |
19 using cricket::TransportChannel; | 21 using cricket::TransportChannel; |
20 using cricket::FakeTransportChannel; | 22 using cricket::FakeTransportChannel; |
(...skipping 22 matching lines...) Expand all Loading... |
43 FakeTransportChannel* CreateChannel(int component) { | 45 FakeTransportChannel* CreateChannel(int component) { |
44 return static_cast<FakeTransportChannel*>( | 46 return static_cast<FakeTransportChannel*>( |
45 transport_->CreateChannel(component)); | 47 transport_->CreateChannel(component)); |
46 } | 48 } |
47 void DestroyChannel() { | 49 void DestroyChannel() { |
48 transport_->DestroyChannel(1); | 50 transport_->DestroyChannel(1); |
49 channel_ = NULL; | 51 channel_ = NULL; |
50 } | 52 } |
51 | 53 |
52 protected: | 54 protected: |
53 rtc::scoped_ptr<FakeTransport> transport_; | 55 std::unique_ptr<FakeTransport> transport_; |
54 FakeTransportChannel* channel_; | 56 FakeTransportChannel* channel_; |
55 }; | 57 }; |
56 | 58 |
57 // This test verifies channels are created with proper ICE | 59 // This test verifies channels are created with proper ICE |
58 // role, tiebreaker and remote ice mode and credentials after offer and | 60 // role, tiebreaker and remote ice mode and credentials after offer and |
59 // answer negotiations. | 61 // answer negotiations. |
60 TEST_F(TransportTest, TestChannelIceParameters) { | 62 TEST_F(TransportTest, TestChannelIceParameters) { |
61 transport_->SetIceRole(cricket::ICEROLE_CONTROLLING); | 63 transport_->SetIceRole(cricket::ICEROLE_CONTROLLING); |
62 transport_->SetIceTiebreaker(99U); | 64 transport_->SetIceTiebreaker(99U); |
63 cricket::TransportDescription local_desc(kIceUfrag1, kIcePwd1); | 65 cricket::TransportDescription local_desc(kIceUfrag1, kIcePwd1); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), cricket::ICEMODE_FULL, | 228 rtc::CreateRandomString(cricket::ICE_PWD_LENGTH), cricket::ICEMODE_FULL, |
227 cricket::CONNECTIONROLE_NONE, nullptr); | 229 cricket::CONNECTIONROLE_NONE, nullptr); |
228 transport_->SetLocalTransportDescription(faketransport_desc, | 230 transport_->SetLocalTransportDescription(faketransport_desc, |
229 cricket::CA_OFFER, nullptr); | 231 cricket::CA_OFFER, nullptr); |
230 transport_->ConnectChannels(); | 232 transport_->ConnectChannels(); |
231 EXPECT_TRUE(transport_->GetStats(&stats)); | 233 EXPECT_TRUE(transport_->GetStats(&stats)); |
232 ASSERT_EQ(1U, stats.channel_stats.size()); | 234 ASSERT_EQ(1U, stats.channel_stats.size()); |
233 EXPECT_EQ(1, stats.channel_stats[0].component); | 235 EXPECT_EQ(1, stats.channel_stats[0].component); |
234 } | 236 } |
235 | 237 |
OLD | NEW |