OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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> | 11 #include <memory> |
12 | 12 |
13 #include "webrtc/base/gunit.h" | 13 #include "webrtc/base/gunit.h" |
14 #include "webrtc/base/thread.h" | 14 #include "webrtc/base/thread.h" |
15 #include "webrtc/p2p/base/fakeportallocator.h" | 15 #include "webrtc/p2p/base/fakeportallocator.h" |
16 #include "webrtc/p2p/base/portallocator.h" | 16 #include "webrtc/p2p/base/portallocator.h" |
17 | 17 |
18 static const char kContentName[] = "test content"; | 18 static const char kContentName[] = "test content"; |
19 // Based on ICE_UFRAG_LENGTH | 19 // Based on ICE_UFRAG_LENGTH |
20 static const char kIceUfrag[] = "TESTICEUFRAG0000"; | 20 static const char kIceUfrag[] = "UF00"; |
21 // Based on ICE_PWD_LENGTH | 21 // Based on ICE_PWD_LENGTH |
22 static const char kIcePwd[] = "TESTICEPWD00000000000000"; | 22 static const char kIcePwd[] = "TESTICEPWD00000000000000"; |
23 static const char kTurnUsername[] = "test"; | 23 static const char kTurnUsername[] = "test"; |
24 static const char kTurnPassword[] = "test"; | 24 static const char kTurnPassword[] = "test"; |
25 | 25 |
26 class PortAllocatorTest : public testing::Test, public sigslot::has_slots<> { | 26 class PortAllocatorTest : public testing::Test, public sigslot::has_slots<> { |
27 public: | 27 public: |
28 PortAllocatorTest() { | 28 PortAllocatorTest() { |
29 allocator_.reset( | 29 allocator_.reset( |
30 new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr)); | 30 new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr)); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 std::unique_ptr<cricket::FakePortAllocatorSession> session( | 196 std::unique_ptr<cricket::FakePortAllocatorSession> session( |
197 static_cast<cricket::FakePortAllocatorSession*>( | 197 static_cast<cricket::FakePortAllocatorSession*>( |
198 allocator_->TakePooledSession(kContentName, 1, kIceUfrag, kIcePwd) | 198 allocator_->TakePooledSession(kContentName, 1, kIceUfrag, kIcePwd) |
199 .release())); | 199 .release())); |
200 EXPECT_EQ(1, session->transport_info_update_count()); | 200 EXPECT_EQ(1, session->transport_info_update_count()); |
201 EXPECT_EQ(kContentName, session->content_name()); | 201 EXPECT_EQ(kContentName, session->content_name()); |
202 EXPECT_EQ(1, session->component()); | 202 EXPECT_EQ(1, session->component()); |
203 EXPECT_EQ(kIceUfrag, session->ice_ufrag()); | 203 EXPECT_EQ(kIceUfrag, session->ice_ufrag()); |
204 EXPECT_EQ(kIcePwd, session->ice_pwd()); | 204 EXPECT_EQ(kIcePwd, session->ice_pwd()); |
205 } | 205 } |
OLD | NEW |