| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 "webrtc/call/rtp_demuxer.h" | 11 #include "webrtc/call/rtp_demuxer.h" |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "webrtc/call/rsid_resolution_observer.h" | 16 #include "webrtc/call/rsid_resolution_observer.h" |
| 17 #include "webrtc/call/rtp_packet_sink_interface.h" | 17 #include "webrtc/call/test/mock_rtp_packet_sink_interface.h" |
| 18 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
| 19 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" | 19 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" |
| 20 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 20 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
| 21 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" | 21 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" |
| 22 #include "webrtc/rtc_base/arraysize.h" | 22 #include "webrtc/rtc_base/arraysize.h" |
| 23 #include "webrtc/rtc_base/basictypes.h" | 23 #include "webrtc/rtc_base/basictypes.h" |
| 24 #include "webrtc/rtc_base/checks.h" | 24 #include "webrtc/rtc_base/checks.h" |
| 25 #include "webrtc/rtc_base/ptr_util.h" | 25 #include "webrtc/rtc_base/ptr_util.h" |
| 26 #include "webrtc/test/gmock.h" | 26 #include "webrtc/test/gmock.h" |
| 27 #include "webrtc/test/gtest.h" | 27 #include "webrtc/test/gtest.h" |
| 28 | 28 |
| 29 namespace webrtc { | 29 namespace webrtc { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 using ::testing::_; | 33 using ::testing::_; |
| 34 using ::testing::AtLeast; | 34 using ::testing::AtLeast; |
| 35 using ::testing::InSequence; | 35 using ::testing::InSequence; |
| 36 using ::testing::NiceMock; | 36 using ::testing::NiceMock; |
| 37 | 37 |
| 38 class MockRtpPacketSink : public RtpPacketSinkInterface { | |
| 39 public: | |
| 40 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived&)); | |
| 41 }; | |
| 42 | |
| 43 class MockRsidResolutionObserver : public RsidResolutionObserver { | 38 class MockRsidResolutionObserver : public RsidResolutionObserver { |
| 44 public: | 39 public: |
| 45 MOCK_METHOD2(OnRsidResolved, void(const std::string& rsid, uint32_t ssrc)); | 40 MOCK_METHOD2(OnRsidResolved, void(const std::string& rsid, uint32_t ssrc)); |
| 46 }; | 41 }; |
| 47 | 42 |
| 48 MATCHER_P(SamePacketAs, other, "") { | 43 MATCHER_P(SamePacketAs, other, "") { |
| 49 return arg.Ssrc() == other.Ssrc() && | 44 return arg.Ssrc() == other.Ssrc() && |
| 50 arg.SequenceNumber() == other.SequenceNumber(); | 45 arg.SequenceNumber() == other.SequenceNumber(); |
| 51 } | 46 } |
| 52 | 47 |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 DregisterationOfNeverRegisteredRsidResolutionObserverDisallowed) { | 591 DregisterationOfNeverRegisteredRsidResolutionObserverDisallowed) { |
| 597 RtpDemuxer demuxer; | 592 RtpDemuxer demuxer; |
| 598 MockRsidResolutionObserver observer; | 593 MockRsidResolutionObserver observer; |
| 599 EXPECT_DEATH(demuxer.DeregisterRsidResolutionObserver(&observer), ""); | 594 EXPECT_DEATH(demuxer.DeregisterRsidResolutionObserver(&observer), ""); |
| 600 } | 595 } |
| 601 | 596 |
| 602 #endif | 597 #endif |
| 603 | 598 |
| 604 } // namespace | 599 } // namespace |
| 605 } // namespace webrtc | 600 } // namespace webrtc |
| OLD | NEW |