OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 receive_statistics_->IncomingPacket(header1_, kPacketSize1, false); | 136 receive_statistics_->IncomingPacket(header1_, kPacketSize1, false); |
137 StreamStatistician* statistician = | 137 StreamStatistician* statistician = |
138 receive_statistics_->GetStatistician(kSsrc1); | 138 receive_statistics_->GetStatistician(kSsrc1); |
139 ASSERT_TRUE(statistician != NULL); | 139 ASSERT_TRUE(statistician != NULL); |
140 | 140 |
141 StreamDataCounters counters; | 141 StreamDataCounters counters; |
142 statistician->GetReceiveStreamDataCounters(&counters); | 142 statistician->GetReceiveStreamDataCounters(&counters); |
143 EXPECT_GT(counters.first_packet_time_ms, -1); | 143 EXPECT_GT(counters.first_packet_time_ms, -1); |
144 EXPECT_EQ(1u, counters.transmitted.packets); | 144 EXPECT_EQ(1u, counters.transmitted.packets); |
145 | 145 |
146 statistician->ResetStatistics(); | |
147 // GetReceiveStreamDataCounters includes reset counter values. | |
148 statistician->GetReceiveStreamDataCounters(&counters); | |
149 EXPECT_GT(counters.first_packet_time_ms, -1); | |
150 EXPECT_EQ(1u, counters.transmitted.packets); | |
151 | |
152 receive_statistics_->IncomingPacket(header1_, kPacketSize1, false); | 146 receive_statistics_->IncomingPacket(header1_, kPacketSize1, false); |
153 statistician->GetReceiveStreamDataCounters(&counters); | 147 statistician->GetReceiveStreamDataCounters(&counters); |
154 EXPECT_GT(counters.first_packet_time_ms, -1); | 148 EXPECT_GT(counters.first_packet_time_ms, -1); |
155 EXPECT_EQ(2u, counters.transmitted.packets); | 149 EXPECT_EQ(2u, counters.transmitted.packets); |
156 } | 150 } |
157 | 151 |
158 TEST_F(ReceiveStatisticsTest, RtcpCallbacks) { | 152 TEST_F(ReceiveStatisticsTest, RtcpCallbacks) { |
159 class TestCallback : public RtcpStatisticsCallback { | 153 class TestCallback : public RtcpStatisticsCallback { |
160 public: | 154 public: |
161 TestCallback() | 155 TestCallback() |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 callback.Matches(1, kSsrc1, expected); | 372 callback.Matches(1, kSsrc1, expected); |
379 | 373 |
380 receive_statistics_->FecPacketReceived(header1_, | 374 receive_statistics_->FecPacketReceived(header1_, |
381 kPacketSize1 + kHeaderLength); | 375 kPacketSize1 + kHeaderLength); |
382 expected.fec.payload_bytes = kPacketSize1; | 376 expected.fec.payload_bytes = kPacketSize1; |
383 expected.fec.header_bytes = kHeaderLength; | 377 expected.fec.header_bytes = kHeaderLength; |
384 expected.fec.packets = 1; | 378 expected.fec.packets = 1; |
385 callback.Matches(2, kSsrc1, expected); | 379 callback.Matches(2, kSsrc1, expected); |
386 } | 380 } |
387 } // namespace webrtc | 381 } // namespace webrtc |
OLD | NEW |