OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
8 #include "media/cast/cast_defines.h" | 8 #include "media/cast/cast_defines.h" |
9 #include "media/cast/net/cast_transport_config.h" | 9 #include "media/cast/net/cast_transport_config.h" |
10 #include "media/cast/net/pacing/paced_sender.h" | 10 #include "media/cast/net/pacing/paced_sender.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 EXPECT_EQ(expected_rtt_according_to_sender, | 173 EXPECT_EQ(expected_rtt_according_to_sender, |
174 rtcp_for_sender_.current_round_trip_time()); | 174 rtcp_for_sender_.current_round_trip_time()); |
175 #ifdef SENDER_PROVIDES_REPORT_BLOCK | 175 #ifdef SENDER_PROVIDES_REPORT_BLOCK |
176 EXPECT_EQ(expected_rtt_according_to_receiver, | 176 EXPECT_EQ(expected_rtt_according_to_receiver, |
177 rtcp_for_receiver_.current_round_trip_time()); | 177 rtcp_for_receiver_.current_round_trip_time()); |
178 #endif | 178 #endif |
179 | 179 |
180 // Receiver --> Sender | 180 // Receiver --> Sender |
181 RtpReceiverStatistics stats; | 181 RtpReceiverStatistics stats; |
182 rtcp_for_receiver_.SendRtcpFromRtpReceiver( | 182 rtcp_for_receiver_.SendRtcpFromRtpReceiver( |
| 183 rtcp_for_receiver_.ConvertToNTPAndSave(receiver_clock_->NowTicks()), |
183 NULL, base::TimeDelta(), NULL, &stats); | 184 NULL, base::TimeDelta(), NULL, &stats); |
184 expected_rtt_according_to_sender = one_way_trip_time * 2; | 185 expected_rtt_according_to_sender = one_way_trip_time * 2; |
185 EXPECT_EQ(expected_rtt_according_to_sender, | 186 EXPECT_EQ(expected_rtt_according_to_sender, |
186 rtcp_for_sender_.current_round_trip_time()); | 187 rtcp_for_sender_.current_round_trip_time()); |
187 #ifdef SENDER_PROVIDES_REPORT_BLOCK | 188 #ifdef SENDER_PROVIDES_REPORT_BLOCK |
188 EXPECT_EQ(expected_rtt_according_to_receiver, | 189 EXPECT_EQ(expected_rtt_according_to_receiver, |
189 rtcp_for_receiver_.current_round_trip_time(); | 190 rtcp_for_receiver_.current_round_trip_time(); |
190 #endif | 191 #endif |
191 | 192 |
192 // In the next iteration of this loop, after the receiver gets the sender | 193 // In the next iteration of this loop, after the receiver gets the sender |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 base::TimeTicks out_3 = ConvertNtpToTimeTicks(ntp_seconds_3, ntp_fraction_3); | 240 base::TimeTicks out_3 = ConvertNtpToTimeTicks(ntp_seconds_3, ntp_fraction_3); |
240 EXPECT_EQ(input_time, out_3); // Verify inverse. | 241 EXPECT_EQ(input_time, out_3); // Verify inverse. |
241 | 242 |
242 // Verify delta. | 243 // Verify delta. |
243 EXPECT_EQ((out_3 - out_2), time_delta); | 244 EXPECT_EQ((out_3 - out_2), time_delta); |
244 EXPECT_NEAR((ntp_fraction_3 - ntp_fraction_2), 0xffffffff / 2, 1); | 245 EXPECT_NEAR((ntp_fraction_3 - ntp_fraction_2), 0xffffffff / 2, 1); |
245 } | 246 } |
246 | 247 |
247 } // namespace cast | 248 } // namespace cast |
248 } // namespace media | 249 } // namespace media |
OLD | NEW |