OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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> |
| 6 |
5 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
6 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
7 #include "media/cast/framer/cast_message_builder.h" | 9 #include "media/cast/framer/cast_message_builder.h" |
8 #include "media/cast/rtcp/rtcp.h" | 10 #include "media/cast/rtcp/rtcp.h" |
9 #include "media/cast/rtp_receiver/rtp_receiver_defines.h" | 11 #include "media/cast/rtp_receiver/rtp_receiver_defines.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 | 13 |
12 namespace media { | 14 namespace media { |
13 namespace cast { | 15 namespace cast { |
14 | 16 |
15 namespace { | 17 namespace { |
16 static const uint32 kSsrc = 0x1234; | 18 static const uint32 kSsrc = 0x1234; |
17 static const uint32 kShortTimeIncrementMs = 10; | 19 static const uint32 kShortTimeIncrementMs = 10; |
18 static const uint32 kLongTimeIncrementMs = 40; | 20 static const uint32 kLongTimeIncrementMs = 40; |
19 static const int64 kStartMillisecond = GG_INT64_C(12345678900000); | 21 static const int64 kStartMillisecond = INT64_C(12345678900000); |
20 | 22 |
21 typedef std::map<uint32, size_t> MissingPacketsMap; | 23 typedef std::map<uint32, size_t> MissingPacketsMap; |
22 | 24 |
23 class NackFeedbackVerification : public RtpPayloadFeedback { | 25 class NackFeedbackVerification : public RtpPayloadFeedback { |
24 public: | 26 public: |
25 NackFeedbackVerification() | 27 NackFeedbackVerification() |
26 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} | 28 : triggered_(false), missing_packets_(), last_frame_acked_(0) {} |
27 | 29 |
28 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) OVERRIDE { | 30 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) OVERRIDE { |
29 EXPECT_EQ(kSsrc, cast_feedback.media_ssrc_); | 31 EXPECT_EQ(kSsrc, cast_feedback.media_ssrc_); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 SetFrameId(frame_id); | 503 SetFrameId(frame_id); |
502 InsertPacket(); | 504 InsertPacket(); |
503 testing_clock_.Advance( | 505 testing_clock_.Advance( |
504 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); | 506 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); |
505 EXPECT_TRUE(feedback_.triggered()); | 507 EXPECT_TRUE(feedback_.triggered()); |
506 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); | 508 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); |
507 } | 509 } |
508 | 510 |
509 } // namespace cast | 511 } // namespace cast |
510 } // namespace media | 512 } // namespace media |
OLD | NEW |