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

Unified Diff: media/cast/sender/audio_encoder_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/sender/audio_encoder_unittest.cc
diff --git a/media/cast/sender/audio_encoder_unittest.cc b/media/cast/sender/audio_encoder_unittest.cc
index 48ebdc1564d09abc6b584ba41fdcf70ea3dd0f15..f6c6306014197dca8eba1932b27a19cf905b8087 100644
--- a/media/cast/sender/audio_encoder_unittest.cc
+++ b/media/cast/sender/audio_encoder_unittest.cc
@@ -14,6 +14,7 @@
#include "media/base/media.h"
#include "media/cast/cast_config.h"
#include "media/cast/cast_environment.h"
+#include "media/cast/common/rtp_time.h"
#include "media/cast/sender/audio_encoder.h"
#include "media/cast/test/fake_single_thread_task_runner.h"
#include "media/cast/test/utility/audio_utility.h"
@@ -28,7 +29,7 @@ namespace {
class TestEncodedAudioFrameReceiver {
public:
- TestEncodedAudioFrameReceiver() : frames_received_(0), rtp_lower_bound_(0) {}
+ TestEncodedAudioFrameReceiver() : frames_received_(0) {}
virtual ~TestEncodedAudioFrameReceiver() {}
int frames_received() const { return frames_received_; }
@@ -53,7 +54,8 @@ class TestEncodedAudioFrameReceiver {
// of the fixed frame size.
EXPECT_LE(rtp_lower_bound_, encoded_frame->rtp_timestamp);
rtp_lower_bound_ = encoded_frame->rtp_timestamp;
- EXPECT_EQ(0u, encoded_frame->rtp_timestamp % samples_per_frame_);
+ EXPECT_EQ(RtpTimeDelta(), (encoded_frame->rtp_timestamp - RtpTimeTicks()) %
+ RtpTimeDelta::FromTicks(samples_per_frame_));
EXPECT_TRUE(!encoded_frame->data.empty());
EXPECT_LE(lower_bound_, encoded_frame->reference_time);
@@ -68,7 +70,7 @@ class TestEncodedAudioFrameReceiver {
private:
int frames_received_;
- uint32 rtp_lower_bound_;
+ RtpTimeTicks rtp_lower_bound_;
int samples_per_frame_;
base::TimeTicks lower_bound_;
base::TimeTicks upper_bound_;

Powered by Google App Engine
This is Rietveld 408576698