Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: media/cast/net/rtp/framer_unittest.cc

Issue 388663003: Cast: Reshuffle files under media/cast (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing includes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/net/rtp/framer.cc ('k') | media/cast/net/rtp/mock_rtp_feedback.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/rtp/framer_unittest.cc
diff --git a/media/cast/framer/framer_unittest.cc b/media/cast/net/rtp/framer_unittest.cc
similarity index 90%
rename from media/cast/framer/framer_unittest.cc
rename to media/cast/net/rtp/framer_unittest.cc
index ad53ef06eee5461a7ab1ca8bc6625581dc9f0dd1..2692e179c75ba56a6e099c43755e9e7257f92fbc 100644
--- a/media/cast/framer/framer_unittest.cc
+++ b/media/cast/net/rtp/framer_unittest.cc
@@ -3,8 +3,9 @@
// found in the LICENSE file.
#include "base/test/simple_test_tick_clock.h"
-#include "media/cast/framer/framer.h"
-#include "media/cast/rtp_receiver/mock_rtp_payload_feedback.h"
+#include "media/cast/net/cast_transport_defines.h"
+#include "media/cast/net/rtp/framer.h"
+#include "media/cast/net/rtp/mock_rtp_payload_feedback.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
@@ -33,14 +34,14 @@ class FramerTest : public ::testing::Test {
};
TEST_F(FramerTest, EmptyState) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = false;
EXPECT_FALSE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
}
TEST_F(FramerTest, AlwaysStartWithKey) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool complete = false;
bool multiple = false;
@@ -60,14 +61,14 @@ TEST_F(FramerTest, AlwaysStartWithKey) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_TRUE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(1u, frame.frame_id);
EXPECT_EQ(1u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
}
TEST_F(FramerTest, CompleteFrame) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool complete = false;
bool multiple = false;
@@ -81,7 +82,7 @@ TEST_F(FramerTest, CompleteFrame) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(0u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -107,7 +108,7 @@ TEST_F(FramerTest, CompleteFrame) {
}
TEST_F(FramerTest, DuplicatePackets) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool complete = false;
bool multiple = false;
@@ -139,7 +140,7 @@ TEST_F(FramerTest, DuplicatePackets) {
EXPECT_TRUE(complete);
EXPECT_FALSE(duplicate);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_FALSE(multiple);
EXPECT_EQ(0u, frame.referenced_frame_id);
@@ -150,7 +151,7 @@ TEST_F(FramerTest, DuplicatePackets) {
EXPECT_FALSE(complete);
EXPECT_TRUE(duplicate);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(0u, frame.frame_id);
EXPECT_FALSE(multiple);
EXPECT_EQ(0u, frame.referenced_frame_id);
@@ -184,7 +185,7 @@ TEST_F(FramerTest, DuplicatePackets) {
EXPECT_TRUE(complete);
EXPECT_FALSE(duplicate);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(1u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
EXPECT_FALSE(multiple);
@@ -196,14 +197,14 @@ TEST_F(FramerTest, DuplicatePackets) {
EXPECT_FALSE(complete);
EXPECT_TRUE(duplicate);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(1u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
EXPECT_FALSE(multiple);
}
TEST_F(FramerTest, ContinuousSequence) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool complete = false;
bool multiple = false;
@@ -217,7 +218,7 @@ TEST_F(FramerTest, ContinuousSequence) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(0u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -234,7 +235,7 @@ TEST_F(FramerTest, ContinuousSequence) {
TEST_F(FramerTest, Wrap) {
// Insert key frame, frame_id = 255 (will jump to that)
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = true;
bool duplicate = false;
@@ -248,7 +249,7 @@ TEST_F(FramerTest, Wrap) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(255u, frame.frame_id);
EXPECT_EQ(255u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -261,14 +262,14 @@ TEST_F(FramerTest, Wrap) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(256u, frame.frame_id);
EXPECT_EQ(255u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
}
TEST_F(FramerTest, Reset) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool complete = false;
bool multiple = true;
@@ -284,7 +285,7 @@ TEST_F(FramerTest, Reset) {
}
TEST_F(FramerTest, RequireKeyAfterReset) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = false;
bool duplicate = false;
@@ -308,7 +309,7 @@ TEST_F(FramerTest, RequireKeyAfterReset) {
}
TEST_F(FramerTest, BasicNonLastReferenceId) {
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = false;
bool duplicate = false;
@@ -335,7 +336,7 @@ TEST_F(FramerTest, BasicNonLastReferenceId) {
TEST_F(FramerTest, InOrderReferenceFrameSelection) {
// Create pattern: 0, 1, 4, 5.
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = false;
bool duplicate = false;
@@ -360,7 +361,7 @@ TEST_F(FramerTest, InOrderReferenceFrameSelection) {
framer_.InsertPacket(
payload_.data(), payload_.size(), rtp_header_, &duplicate);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(0u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
EXPECT_FALSE(multiple);
@@ -368,14 +369,14 @@ TEST_F(FramerTest, InOrderReferenceFrameSelection) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_TRUE(multiple);
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(1u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_FALSE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(4u, frame.frame_id);
EXPECT_EQ(0u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -394,14 +395,14 @@ TEST_F(FramerTest, InOrderReferenceFrameSelection) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::DEPENDENT, frame.dependency);
+ EXPECT_EQ(EncodedFrame::DEPENDENT, frame.dependency);
EXPECT_EQ(5u, frame.frame_id);
EXPECT_EQ(4u, frame.referenced_frame_id);
}
TEST_F(FramerTest, AudioWrap) {
// All audio frames are marked as key frames.
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = false;
bool duplicate = false;
@@ -415,7 +416,7 @@ TEST_F(FramerTest, AudioWrap) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(254u, frame.frame_id);
EXPECT_EQ(254u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -434,7 +435,7 @@ TEST_F(FramerTest, AudioWrap) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_TRUE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(255u, frame.frame_id);
EXPECT_EQ(255u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -442,7 +443,7 @@ TEST_F(FramerTest, AudioWrap) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(256u, frame.frame_id);
EXPECT_EQ(256u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -450,7 +451,7 @@ TEST_F(FramerTest, AudioWrap) {
TEST_F(FramerTest, AudioWrapWithMissingFrame) {
// All audio frames are marked as key frames.
- transport::EncodedFrame frame;
+ EncodedFrame frame;
bool next_frame = false;
bool multiple = true;
bool duplicate = false;
@@ -464,7 +465,7 @@ TEST_F(FramerTest, AudioWrapWithMissingFrame) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(253u, frame.frame_id);
EXPECT_EQ(253u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
@@ -483,14 +484,14 @@ TEST_F(FramerTest, AudioWrapWithMissingFrame) {
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_FALSE(next_frame);
EXPECT_TRUE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(255u, frame.frame_id);
EXPECT_EQ(255u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
EXPECT_TRUE(framer_.GetEncodedFrame(&frame, &next_frame, &multiple));
EXPECT_TRUE(next_frame);
EXPECT_FALSE(multiple);
- EXPECT_EQ(transport::EncodedFrame::KEY, frame.dependency);
+ EXPECT_EQ(EncodedFrame::KEY, frame.dependency);
EXPECT_EQ(256u, frame.frame_id);
EXPECT_EQ(256u, frame.referenced_frame_id);
framer_.ReleaseFrame(frame.frame_id);
« no previous file with comments | « media/cast/net/rtp/framer.cc ('k') | media/cast/net/rtp/mock_rtp_feedback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698