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

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: Created 5 years, 4 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: 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 0c18e750cc79cbd5938890211b8b64d43ee45135..9c782ac172a8e2170a74d09723876d96bad51618 100644
--- a/webrtc/video/rtc_event_log_unittest.cc
+++ b/webrtc/video/rtc_event_log_unittest.cc
@@ -23,6 +23,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
@@ -33,22 +34,6 @@
namespace webrtc {
-// 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;
-}
-
// Checks that the event has a timestamp, a type and exactly the data field
// corresponding to the type.
::testing::AssertionResult IsValidBasicEvent(const rtclog::Event& event) {
@@ -217,7 +202,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());
@@ -238,7 +224,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++) {
@@ -382,7 +369,8 @@ void LogSessionAndReadBack(size_t rtp_count, unsigned random_seed) {
// 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.
EXPECT_EQ(event_count, parsed_stream.stream_size());

Powered by Google App Engine
This is Rietveld 408576698