Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: webrtc/call/rtx_receive_stream_unittest.cc

Issue 2988853002: Only one implementation of MockRtpPacketSink once (Closed)
Patch Set: . Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/call/rtp_demuxer_unittest.cc ('k') | webrtc/call/test/mock_rtp_packet_sink_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/rtx_receive_stream.h" 11 #include "webrtc/call/rtx_receive_stream.h"
12 #include "webrtc/call/test/mock_rtp_packet_sink_interface.h"
12 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h" 13 #include "webrtc/modules/rtp_rtcp/include/rtp_header_extension_map.h"
13 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" 14 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h"
14 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h" 15 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
15 #include "webrtc/test/gmock.h" 16 #include "webrtc/test/gmock.h"
16 #include "webrtc/test/gtest.h" 17 #include "webrtc/test/gtest.h"
17 18
18 namespace webrtc { 19 namespace webrtc {
19 20
20 namespace { 21 namespace {
21 22
22 using ::testing::_; 23 using ::testing::_;
23 using ::testing::StrictMock; 24 using ::testing::StrictMock;
24 25
25 class MockRtpPacketSink : public RtpPacketSinkInterface {
26 public:
27 MOCK_METHOD1(OnRtpPacket, void(const RtpPacketReceived&));
28 };
29
30 constexpr int kMediaPayloadType = 100; 26 constexpr int kMediaPayloadType = 100;
31 constexpr int kRtxPayloadType = 98; 27 constexpr int kRtxPayloadType = 98;
32 constexpr uint32_t kMediaSSRC = 0x3333333; 28 constexpr uint32_t kMediaSSRC = 0x3333333;
33 constexpr uint16_t kMediaSeqno = 0x5657; 29 constexpr uint16_t kMediaSeqno = 0x5657;
34 30
35 constexpr uint8_t kRtxPacket[] = { 31 constexpr uint8_t kRtxPacket[] = {
36 0x80, // Version 2. 32 0x80, // Version 2.
37 98, // Payload type. 33 98, // Payload type.
38 0x12, 0x34, // Seqno. 34 0x12, 0x34, // Seqno.
39 0x11, 0x11, 0x11, 0x11, // Timestamp. 35 0x11, 0x11, 0x11, 0x11, // Timestamp.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee)); 122 EXPECT_THAT(packet.payload(), testing::ElementsAre(0xee));
127 VideoRotation rotation = kVideoRotation_0; 123 VideoRotation rotation = kVideoRotation_0;
128 EXPECT_TRUE(packet.GetExtension<VideoOrientation>(&rotation)); 124 EXPECT_TRUE(packet.GetExtension<VideoOrientation>(&rotation));
129 EXPECT_EQ(rotation, kVideoRotation_90); 125 EXPECT_EQ(rotation, kVideoRotation_90);
130 })); 126 }));
131 127
132 rtx_sink.OnRtpPacket(rtx_packet); 128 rtx_sink.OnRtpPacket(rtx_packet);
133 } 129 }
134 130
135 } // namespace webrtc 131 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/rtp_demuxer_unittest.cc ('k') | webrtc/call/test/mock_rtp_packet_sink_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698