| 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "media/cast/net/rtcp/rtcp.h" | 9 #include "media/cast/net/rtcp/rtcp.h" |
| 10 #include "media/cast/net/rtp/cast_message_builder.h" | 10 #include "media/cast/net/rtp/cast_message_builder.h" |
| 11 #include "media/cast/net/rtp/framer.h" | 11 #include "media/cast/net/rtp/framer.h" |
| 12 #include "media/cast/net/rtp/rtp_receiver_defines.h" | 12 #include "media/cast/net/rtp/rtp_defines.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 namespace cast { | 16 namespace cast { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 static const uint32 kSsrc = 0x1234; | 19 static const uint32 kSsrc = 0x1234; |
| 20 static const uint32 kShortTimeIncrementMs = 10; | 20 static const uint32 kShortTimeIncrementMs = 10; |
| 21 static const uint32 kLongTimeIncrementMs = 40; | 21 static const uint32 kLongTimeIncrementMs = 40; |
| 22 static const int64 kStartMillisecond = INT64_C(12345678900000); | 22 static const int64 kStartMillisecond = INT64_C(12345678900000); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 false, | 132 false, |
| 133 max_unacked_frames)); | 133 max_unacked_frames)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 NackFeedbackVerification feedback_; | 136 NackFeedbackVerification feedback_; |
| 137 Framer framer_; | 137 Framer framer_; |
| 138 scoped_ptr<CastMessageBuilder> cast_msg_builder_; | 138 scoped_ptr<CastMessageBuilder> cast_msg_builder_; |
| 139 RtpCastHeader rtp_header_; | 139 RtpCastHeader rtp_header_; |
| 140 base::SimpleTestTickClock testing_clock_; | 140 base::SimpleTestTickClock testing_clock_; |
| 141 | 141 |
| 142 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(CastMessageBuilderTest); | 143 DISALLOW_COPY_AND_ASSIGN(CastMessageBuilderTest); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 TEST_F(CastMessageBuilderTest, OneFrameNackList) { | 146 TEST_F(CastMessageBuilderTest, OneFrameNackList) { |
| 146 SetFrameIds(0, 0); | 147 SetFrameIds(0, 0); |
| 147 SetPacketId(4); | 148 SetPacketId(4); |
| 148 SetMaxPacketId(10); | 149 SetMaxPacketId(10); |
| 149 InsertPacket(); | 150 InsertPacket(); |
| 150 testing_clock_.Advance( | 151 testing_clock_.Advance( |
| 151 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); | 152 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 SetFrameIds(frame_id, frame_id - 1); | 428 SetFrameIds(frame_id, frame_id - 1); |
| 428 InsertPacket(); | 429 InsertPacket(); |
| 429 testing_clock_.Advance( | 430 testing_clock_.Advance( |
| 430 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); | 431 base::TimeDelta::FromMilliseconds(kShortTimeIncrementMs)); |
| 431 EXPECT_TRUE(feedback_.triggered()); | 432 EXPECT_TRUE(feedback_.triggered()); |
| 432 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); | 433 EXPECT_EQ(frame_id, feedback_.last_frame_acked()); |
| 433 } | 434 } |
| 434 | 435 |
| 435 } // namespace cast | 436 } // namespace cast |
| 436 } // namespace media | 437 } // namespace media |
| OLD | NEW |