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

Unified Diff: media/cast/logging/stats_event_subscriber_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/logging/stats_event_subscriber_unittest.cc
diff --git a/media/cast/logging/stats_event_subscriber_unittest.cc b/media/cast/logging/stats_event_subscriber_unittest.cc
index d649c8960bf87b3546176a44c4d100caef921a62..58bf26dc7aaa971ce748f7a0246277798799fbc7 100644
--- a/media/cast/logging/stats_event_subscriber_unittest.cc
+++ b/media/cast/logging/stats_event_subscriber_unittest.cc
@@ -67,7 +67,7 @@ class StatsEventSubscriberTest : public ::testing::Test {
TEST_F(StatsEventSubscriberTest, CaptureEncode) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32 frame_id = 0;
int extra_frames = 50;
// Only the first |extra_frames| frames logged will be taken into account
@@ -110,7 +110,7 @@ TEST_F(StatsEventSubscriberTest, CaptureEncode) {
dropped_frames++;
}
AdvanceClocks(base::TimeDelta::FromMicroseconds(34567));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -147,7 +147,7 @@ TEST_F(StatsEventSubscriberTest, CaptureEncode) {
TEST_F(StatsEventSubscriberTest, Encode) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32 frame_id = 0;
int num_frames = 10;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -173,7 +173,7 @@ TEST_F(StatsEventSubscriberTest, Encode) {
last_event_time = sender_clock_->NowTicks();
AdvanceClocks(base::TimeDelta::FromMicroseconds(35678));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -215,7 +215,7 @@ TEST_F(StatsEventSubscriberTest, Encode) {
TEST_F(StatsEventSubscriberTest, Decode) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32 frame_id = 0;
int num_frames = 10;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -229,7 +229,7 @@ TEST_F(StatsEventSubscriberTest, Decode) {
cast_environment_->logger()->DispatchFrameEvent(decode_event.Pass());
AdvanceClocks(base::TimeDelta::FromMicroseconds(36789));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -251,7 +251,7 @@ TEST_F(StatsEventSubscriberTest, Decode) {
TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32 frame_id = 0;
int num_frames = 10;
int late_frames = 0;
@@ -269,7 +269,7 @@ TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
cast_environment_->logger()->DispatchFrameEvent(playout_event.Pass());
AdvanceClocks(base::TimeDelta::FromMicroseconds(37890));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -286,7 +286,7 @@ TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
TEST_F(StatsEventSubscriberTest, E2ELatency) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32 frame_id = 0;
int num_frames = 10;
base::TimeDelta total_latency;
@@ -315,7 +315,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
playout_event->delay_delta = delay;
cast_environment_->logger()->DispatchFrameEvent(playout_event.Pass());
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -333,7 +333,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
TEST_F(StatsEventSubscriberTest, Packets) {
Init(VIDEO_EVENT);
- uint32 rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
int num_packets = 10;
int num_latency_recorded_packets = 0;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -557,14 +557,14 @@ TEST_F(StatsEventSubscriberTest, Histograms) {
Init(VIDEO_EVENT);
AdvanceClocks(base::TimeDelta::FromMilliseconds(123));
- uint32 rtp_timestamp = 123;
+ RtpTimeTicks rtp_timestamp = RtpTimeTicks().Expand(UINT32_C(123));
uint32 frame_id = 0;
// 10 Frames with capture latency in the bucket of "10-14"ms.
// 10 Frames with encode time in the bucket of "15-19"ms.
for (int i = 0; i < 10; ++i) {
++frame_id;
- ++rtp_timestamp;
+ rtp_timestamp += RtpTimeDelta::FromTicks(1);
scoped_ptr<FrameEvent> capture_begin_event(new FrameEvent());
capture_begin_event->timestamp = sender_clock_->NowTicks();

Powered by Google App Engine
This is Rietveld 408576698