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

Unified Diff: media/cast/logging/logging_unittest.cc

Issue 136903003: cast: Wire upp logging to be sent over RTCP between receiver and sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
Index: media/cast/logging/logging_unittest.cc
diff --git a/media/cast/logging/logging_unittest.cc b/media/cast/logging/logging_unittest.cc
index 7dd2ac714ee8a8a3bf5a3b0d05d5ece6bea960c7..dd03a1a3897d90bdb30b2ea7632feb201b7e8310 100644
--- a/media/cast/logging/logging_unittest.cc
+++ b/media/cast/logging/logging_unittest.cc
@@ -23,7 +23,7 @@ static const int64 kStartMillisecond = GG_INT64_C(12345678900000);
class TestLogging : public ::testing::Test {
protected:
- TestLogging() {
+ TestLogging() : config_(false) {
// Enable logging, disable tracing and uma.
config_.enable_data_collection = true;
@@ -257,5 +257,43 @@ TEST_F(TestLogging, GenericLogging) {
EXPECT_NEAR(kBaseValue, sit->second, 2.5);
}
+TEST_F(TestLogging, RtcpMultipleEventFrameLogging) {
+ base::TimeTicks start_time = testing_clock_.NowTicks();
+ base::TimeDelta time_interval = testing_clock_.NowTicks() - start_time;
+ uint32 rtp_timestamp = 0;
+ uint32 frame_id = 0;
+ do {
+ logging_->InsertFrameEvent(testing_clock_.NowTicks(), kAudioFrameCaptured,
+ rtp_timestamp, frame_id);
+ if (frame_id % 2) {
+ logging_->InsertFrameEventWithSize(testing_clock_.NowTicks(),
+ kAudioFrameEncoded, rtp_timestamp, frame_id, 1500);
+ } else if (frame_id % 3) {
+ logging_->InsertFrameEvent(testing_clock_.NowTicks(), kVideoFrameDecoded,
+ rtp_timestamp, frame_id);
+ } else {
+ logging_->InsertFrameEventWithDelay(testing_clock_.NowTicks(),
+ kVideoRenderDelay, rtp_timestamp, frame_id,
+ base::TimeDelta::FromMilliseconds(20));
+ }
+ testing_clock_.Advance(
+ base::TimeDelta::FromMilliseconds(kFrameIntervalMs));
+ rtp_timestamp += kFrameIntervalMs * 90;
+ ++frame_id;
+ time_interval = testing_clock_.NowTicks() - start_time;
+ } while (time_interval.InSeconds() < kIntervalTime1S);
+ // Get logging data.
+ FrameRawMap frame_map = logging_->GetFrameRawData();
+ // Size of map should be equal to the number of frames logged.
+ EXPECT_EQ(frame_id, frame_map.size());
+ // Multiple events captured per frame.
+
+ AudioRtcpRawMap audio_rtcp = logging_->GetAudioRtcpRawData();
+ EXPECT_EQ(0u, audio_rtcp.size());
+
+ VideoRtcpRawMap video_rtcp = logging_->GetVideoRtcpRawData();
+ EXPECT_EQ((frame_id + 1) / 2, video_rtcp.size());
+}
+
} // namespace cast
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698