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

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: Merge TOT 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
« no previous file with comments | « media/cast/logging/logging_raw.cc ('k') | media/cast/rtcp/rtcp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/logging/logging_unittest.cc
diff --git a/media/cast/logging/logging_unittest.cc b/media/cast/logging/logging_unittest.cc
index c9aa9f5dd0631ae303dafbf06c8249aa854d6971..75915de293c0d4823292cdeb0ddee1fcc086f5fa 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 all logging types.
config_.enable_raw_data_collection = true;
config_.enable_stats_data_collection = true;
@@ -260,5 +260,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
« no previous file with comments | « media/cast/logging/logging_raw.cc ('k') | media/cast/rtcp/rtcp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698