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

Unified Diff: webrtc/video/rtc_event_log_unittest.cc

Issue 1295753003: Convenience functions to convert RtcEvents to webrtc types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase and change CHECK to RTC_CHECK Created 5 years, 3 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 | « webrtc/video/rtc_event_log_parser.cc ('k') | webrtc/webrtc.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/rtc_event_log_unittest.cc
diff --git a/webrtc/video/rtc_event_log_unittest.cc b/webrtc/video/rtc_event_log_unittest.cc
index cc8a8d2fdfbbed909334d437d7ad214cd8e64e76..387f4a2339070617875df691b11aaae857e42340 100644
--- a/webrtc/video/rtc_event_log_unittest.cc
+++ b/webrtc/video/rtc_event_log_unittest.cc
@@ -25,6 +25,7 @@
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/video/rtc_event_log.h"
+#include "webrtc/video/rtc_event_log_parser.h"
// Files generated at build-time by the protobuf compiler.
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
@@ -50,23 +51,7 @@ const char* kExtensionNames[] = {RtpExtension::kTOffset,
RtpExtension::kTransportSequenceNumber};
const size_t kNumExtensions = 5;
-} // namepsace
-
-// TODO(terelius): Place this definition with other parsing functions?
-MediaType GetRuntimeMediaType(rtclog::MediaType media_type) {
- switch (media_type) {
- case rtclog::MediaType::ANY:
- return MediaType::ANY;
- case rtclog::MediaType::AUDIO:
- return MediaType::AUDIO;
- case rtclog::MediaType::VIDEO:
- return MediaType::VIDEO;
- case rtclog::MediaType::DATA:
- return MediaType::DATA;
- }
- RTC_NOTREACHED();
- return MediaType::ANY;
-}
+} // namespace
// Checks that the event has a timestamp, a type and exactly the data field
// corresponding to the type.
@@ -129,12 +114,8 @@ void VerifyReceiveStreamConfig(const rtclog::Event& event,
EXPECT_EQ(config.rtp.local_ssrc, receiver_config.local_ssrc());
// Check RTCP settings.
ASSERT_TRUE(receiver_config.has_rtcp_mode());
- if (config.rtp.rtcp_mode == newapi::kRtcpCompound)
- EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_COMPOUND,
- receiver_config.rtcp_mode());
- else
- EXPECT_EQ(rtclog::VideoReceiveConfig::RTCP_REDUCEDSIZE,
- receiver_config.rtcp_mode());
+ EXPECT_EQ(config.rtp.rtcp_mode,
+ RtcEventLogParser::GetRuntimeRtcpMode(receiver_config.rtcp_mode()));
ASSERT_TRUE(receiver_config.has_receiver_reference_time_report());
EXPECT_EQ(config.rtp.rtcp_xr.receiver_reference_time_report,
receiver_config.receiver_reference_time_report());
@@ -236,7 +217,8 @@ void VerifyRtpEvent(const rtclog::Event& event,
ASSERT_TRUE(rtp_packet.has_incoming());
EXPECT_EQ(incoming, rtp_packet.incoming());
ASSERT_TRUE(rtp_packet.has_type());
- EXPECT_EQ(media_type, GetRuntimeMediaType(rtp_packet.type()));
+ EXPECT_EQ(media_type,
+ RtcEventLogParser::GetRuntimeMediaType(rtp_packet.type()));
ASSERT_TRUE(rtp_packet.has_packet_length());
EXPECT_EQ(total_size, rtp_packet.packet_length());
ASSERT_TRUE(rtp_packet.has_header());
@@ -257,7 +239,8 @@ void VerifyRtcpEvent(const rtclog::Event& event,
ASSERT_TRUE(rtcp_packet.has_incoming());
EXPECT_EQ(incoming, rtcp_packet.incoming());
ASSERT_TRUE(rtcp_packet.has_type());
- EXPECT_EQ(media_type, GetRuntimeMediaType(rtcp_packet.type()));
+ EXPECT_EQ(media_type,
+ RtcEventLogParser::GetRuntimeMediaType(rtcp_packet.type()));
ASSERT_TRUE(rtcp_packet.has_packet_data());
ASSERT_EQ(total_size, rtcp_packet.packet_data().size());
for (size_t i = 0; i < total_size; i++) {
@@ -477,7 +460,8 @@ void LogSessionAndReadBack(size_t rtp_count,
// Read the generated file from disk.
rtclog::EventStream parsed_stream;
- ASSERT_TRUE(RtcEventLog::ParseRtcEventLog(temp_filename, &parsed_stream));
+ ASSERT_TRUE(
+ RtcEventLogParser::ParseRtcEventLog(temp_filename, &parsed_stream));
// Verify the result.
const int event_count =
« no previous file with comments | « webrtc/video/rtc_event_log_parser.cc ('k') | webrtc/webrtc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698