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 "media/cast/framer/frame_buffer.h" | 5 #include "media/cast/framer/frame_buffer.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 namespace media { | 8 namespace media { |
9 namespace cast { | 9 namespace cast { |
10 | 10 |
11 class FrameBufferTest : public ::testing::Test { | 11 class FrameBufferTest : public ::testing::Test { |
12 protected: | 12 protected: |
13 FrameBufferTest() {} | 13 FrameBufferTest() {} |
14 | 14 |
15 virtual ~FrameBufferTest() {} | 15 ~FrameBufferTest() {} |
16 | 16 |
17 virtual void SetUp() { | 17 void SetUp() { |
18 payload_.assign(kIpPacketSize, 0); | 18 payload_.assign(kIpPacketSize, 0); |
19 | 19 |
20 // Build a default one packet frame - populate webrtc header. | 20 // Build a default one packet frame - populate webrtc header. |
21 rtp_header_.is_key_frame = false; | 21 rtp_header_.is_key_frame = false; |
22 rtp_header_.frame_id = 0; | 22 rtp_header_.frame_id = 0; |
23 rtp_header_.packet_id = 0; | 23 rtp_header_.packet_id = 0; |
24 rtp_header_.max_packet_id = 0; | 24 rtp_header_.max_packet_id = 0; |
25 rtp_header_.is_reference = false; | 25 rtp_header_.is_reference = false; |
26 rtp_header_.reference_frame_id = 0; | 26 rtp_header_.reference_frame_id = 0; |
27 } | 27 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 buffer_.InsertPacket(payload_.data(), payload_.size(), rtp_header_); | 79 buffer_.InsertPacket(payload_.data(), payload_.size(), rtp_header_); |
80 EXPECT_FALSE(buffer_.Complete()); | 80 EXPECT_FALSE(buffer_.Complete()); |
81 // Insert missing packet. | 81 // Insert missing packet. |
82 rtp_header_.packet_id = 2; | 82 rtp_header_.packet_id = 2; |
83 buffer_.InsertPacket(payload_.data(), payload_.size(), rtp_header_); | 83 buffer_.InsertPacket(payload_.data(), payload_.size(), rtp_header_); |
84 EXPECT_TRUE(buffer_.Complete()); | 84 EXPECT_TRUE(buffer_.Complete()); |
85 } | 85 } |
86 | 86 |
87 } // namespace media | 87 } // namespace media |
88 } // namespace cast | 88 } // namespace cast |
OLD | NEW |