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

Unified Diff: media/cast/net/pacing/paced_sender_unittest.cc

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: media/cast/net/pacing/paced_sender_unittest.cc
diff --git a/media/cast/net/pacing/paced_sender_unittest.cc b/media/cast/net/pacing/paced_sender_unittest.cc
index 1df741584cfcf289be824415df29c79773ad9d5a..eca479882bcc6c75d7230ef83fc48e33f1c3c37d 100644
--- a/media/cast/net/pacing/paced_sender_unittest.cc
+++ b/media/cast/net/pacing/paced_sender_unittest.cc
@@ -25,7 +25,8 @@ static const size_t kNackSize = 105;
static const int64 kStartMillisecond = INT64_C(12345678900000);
static const uint32 kVideoSsrc = 0x1234;
static const uint32 kAudioSsrc = 0x5678;
-static const uint32 kFrameRtpTimestamp = 12345;
+static const uint32_t kVideoFrameRtpTimestamp = 12345;
+static const uint32_t kAudioFrameRtpTimestamp = 23456;
class TestPacketSender : public PacketSender {
public:
@@ -90,7 +91,8 @@ class PacedSenderTest : public ::testing::Test {
base::BigEndianWriter writer(reinterpret_cast<char*>(&packet->data[0]),
packet_size);
bool success = writer.Skip(4);
- success &= writer.WriteU32(kFrameRtpTimestamp);
+ success &= writer.WriteU32(audio ? kAudioFrameRtpTimestamp
+ : kVideoFrameRtpTimestamp);
success &= writer.WriteU32(audio ? kAudioSsrc : kVideoSsrc);
success &= writer.Skip(2);
success &= writer.WriteU16(i);
@@ -183,7 +185,7 @@ TEST_F(PacedSenderTest, BasicPace) {
ASSERT_GE(latest_event_timestamp, e.timestamp);
ASSERT_EQ(PACKET_SENT_TO_NETWORK, e.type);
ASSERT_EQ(VIDEO_EVENT, e.media_type);
- ASSERT_EQ(kFrameRtpTimestamp, e.rtp_timestamp);
+ ASSERT_EQ(kVideoFrameRtpTimestamp, e.rtp_timestamp.lower_32_bits());
ASSERT_EQ(num_of_packets - 1, e.max_packet_id);
ASSERT_EQ(expected_packet_id++, e.packet_id);
ASSERT_EQ(kSize1, e.size);

Powered by Google App Engine
This is Rietveld 408576698