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 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "webrtc/base/gunit.h" | |
14 #include "webrtc/pc/datachannel.h" | 13 #include "webrtc/pc/datachannel.h" |
15 #include "webrtc/pc/sctputils.h" | 14 #include "webrtc/pc/sctputils.h" |
16 #include "webrtc/pc/test/fakedatachannelprovider.h" | 15 #include "webrtc/pc/test/fakedatachannelprovider.h" |
| 16 #include "webrtc/rtc_base/gunit.h" |
17 | 17 |
18 using webrtc::DataChannel; | 18 using webrtc::DataChannel; |
19 using webrtc::SctpSidAllocator; | 19 using webrtc::SctpSidAllocator; |
20 | 20 |
21 static constexpr int kDefaultTimeout = 10000; | 21 static constexpr int kDefaultTimeout = 10000; |
22 | 22 |
23 class FakeDataChannelObserver : public webrtc::DataChannelObserver { | 23 class FakeDataChannelObserver : public webrtc::DataChannelObserver { |
24 public: | 24 public: |
25 FakeDataChannelObserver() | 25 FakeDataChannelObserver() |
26 : messages_received_(0), | 26 : messages_received_(0), |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_CLIENT, &allocated_id)); | 705 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_CLIENT, &allocated_id)); |
706 EXPECT_EQ(even_id, allocated_id); | 706 EXPECT_EQ(even_id, allocated_id); |
707 | 707 |
708 // Verifies that used higher ids are not reused. | 708 // Verifies that used higher ids are not reused. |
709 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_SERVER, &allocated_id)); | 709 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_SERVER, &allocated_id)); |
710 EXPECT_EQ(odd_id + 6, allocated_id); | 710 EXPECT_EQ(odd_id + 6, allocated_id); |
711 | 711 |
712 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_CLIENT, &allocated_id)); | 712 EXPECT_TRUE(allocator_.AllocateSid(rtc::SSL_CLIENT, &allocated_id)); |
713 EXPECT_EQ(even_id + 6, allocated_id); | 713 EXPECT_EQ(even_id + 6, allocated_id); |
714 } | 714 } |
OLD | NEW |