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 "base/test/simple_test_tick_clock.h" | 5 #include "base/test/simple_test_tick_clock.h" |
6 #include "media/cast/framer/framer.h" | 6 #include "media/cast/framer/framer.h" |
7 #include "media/cast/rtp_common/mock_rtp_payload_feedback.h" | 7 #include "media/cast/rtp_common/mock_rtp_payload_feedback.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 namespace cast { | 11 namespace cast { |
12 | 12 |
13 static const int64 kFrameTimeMillisecond = 33; | 13 static const int64 kFrameTimeMillisecond = 33; |
14 | 14 |
15 class FramerTest : public ::testing::Test { | 15 class FramerTest : public ::testing::Test { |
16 protected: | 16 protected: |
17 FramerTest() | 17 FramerTest() |
18 : mock_rtp_payload_feedback_(), | 18 : mock_rtp_payload_feedback_(), |
19 framer_(&mock_rtp_payload_feedback_, 0, true, 0) { | 19 framer_(&mock_rtp_payload_feedback_, 0, true, 0) { |
20 framer_.set_clock(&testing_clock_); | 20 framer_.set_clock(&testing_clock_); |
21 } | 21 } |
22 | 22 |
23 ~FramerTest() {} | 23 virtual ~FramerTest() {} |
24 | 24 |
25 void SetUp() { | 25 virtual void SetUp() { |
26 // Build a default one packet frame - populate webrtc header. | 26 // Build a default one packet frame - populate webrtc header. |
27 rtp_header_.is_key_frame = false; | 27 rtp_header_.is_key_frame = false; |
28 rtp_header_.frame_id = 0; | 28 rtp_header_.frame_id = 0; |
29 rtp_header_.packet_id = 0; | 29 rtp_header_.packet_id = 0; |
30 rtp_header_.max_packet_id = 0; | 30 rtp_header_.max_packet_id = 0; |
31 rtp_header_.is_reference = false; | 31 rtp_header_.is_reference = false; |
32 rtp_header_.reference_frame_id = 0; | 32 rtp_header_.reference_frame_id = 0; |
33 payload_.assign(kIpPacketSize, 0); | 33 payload_.assign(kIpPacketSize, 0); |
34 | 34 |
35 EXPECT_CALL(mock_rtp_payload_feedback_, | 35 EXPECT_CALL(mock_rtp_payload_feedback_, |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 framer_.ReleaseFrame(frame.frame_id); | 342 framer_.ReleaseFrame(frame.frame_id); |
343 EXPECT_TRUE(framer_.GetEncodedAudioFrame(timeout, &frame, &rtp_timestamp, | 343 EXPECT_TRUE(framer_.GetEncodedAudioFrame(timeout, &frame, &rtp_timestamp, |
344 &next_frame)); | 344 &next_frame)); |
345 EXPECT_TRUE(next_frame); | 345 EXPECT_TRUE(next_frame); |
346 EXPECT_EQ(0, frame.frame_id); | 346 EXPECT_EQ(0, frame.frame_id); |
347 framer_.ReleaseFrame(frame.frame_id); | 347 framer_.ReleaseFrame(frame.frame_id); |
348 } | 348 } |
349 | 349 |
350 } // namespace cast | 350 } // namespace cast |
351 } // namespace media | 351 } // namespace media |
OLD | NEW |