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

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: Speculative workaround fix for win8_chromium_ng compile error. 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
« no previous file with comments | « media/cast/logging/stats_event_subscriber.cc ('k') | media/cast/net/cast_transport_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7acfddda21d6482b7c5d0cfee66430f7bb3a3577..6c210e6c662286bc6bb728261ce896621b5d1bd6 100644
--- a/media/cast/logging/stats_event_subscriber_unittest.cc
+++ b/media/cast/logging/stats_event_subscriber_unittest.cc
@@ -72,7 +72,7 @@ class StatsEventSubscriberTest : public ::testing::Test {
TEST_F(StatsEventSubscriberTest, CaptureEncode) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32_t frame_id = 0;
int extra_frames = 50;
// Only the first |extra_frames| frames logged will be taken into account
@@ -117,7 +117,7 @@ TEST_F(StatsEventSubscriberTest, CaptureEncode) {
dropped_frames++;
}
AdvanceClocks(base::TimeDelta::FromMicroseconds(34567));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -154,7 +154,7 @@ TEST_F(StatsEventSubscriberTest, CaptureEncode) {
TEST_F(StatsEventSubscriberTest, Encode) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32_t frame_id = 0;
int num_frames = 10;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -180,7 +180,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++;
}
@@ -222,7 +222,7 @@ TEST_F(StatsEventSubscriberTest, Encode) {
TEST_F(StatsEventSubscriberTest, Decode) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32_t frame_id = 0;
int num_frames = 10;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -236,7 +236,7 @@ TEST_F(StatsEventSubscriberTest, Decode) {
cast_environment_->logger()->DispatchFrameEvent(std::move(decode_event));
AdvanceClocks(base::TimeDelta::FromMicroseconds(36789));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -258,7 +258,7 @@ TEST_F(StatsEventSubscriberTest, Decode) {
TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32_t frame_id = 0;
int num_frames = 10;
int late_frames = 0;
@@ -276,7 +276,7 @@ TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
cast_environment_->logger()->DispatchFrameEvent(std::move(playout_event));
AdvanceClocks(base::TimeDelta::FromMicroseconds(37890));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -293,7 +293,7 @@ TEST_F(StatsEventSubscriberTest, PlayoutDelay) {
TEST_F(StatsEventSubscriberTest, E2ELatency) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
uint32_t frame_id = 0;
int num_frames = 10;
base::TimeDelta total_latency;
@@ -323,7 +323,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
playout_event->delay_delta = delay;
cast_environment_->logger()->DispatchFrameEvent(std::move(playout_event));
- rtp_timestamp += 90;
+ rtp_timestamp += RtpTimeDelta::FromTicks(90);
frame_id++;
}
@@ -341,7 +341,7 @@ TEST_F(StatsEventSubscriberTest, E2ELatency) {
TEST_F(StatsEventSubscriberTest, Packets) {
Init(VIDEO_EVENT);
- uint32_t rtp_timestamp = 0;
+ RtpTimeTicks rtp_timestamp;
int num_packets = 10;
int num_latency_recorded_packets = 0;
base::TimeTicks start_time = sender_clock_->NowTicks();
@@ -568,14 +568,14 @@ TEST_F(StatsEventSubscriberTest, Histograms) {
Init(VIDEO_EVENT);
AdvanceClocks(base::TimeDelta::FromMilliseconds(123));
- uint32_t rtp_timestamp = 123;
+ RtpTimeTicks rtp_timestamp = RtpTimeTicks().Expand(UINT32_C(123));
uint32_t 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();
« no previous file with comments | « media/cast/logging/stats_event_subscriber.cc ('k') | media/cast/net/cast_transport_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698