PrintTo functions for RTCStats added in rtcstatscollector_unittest.cc

Future test code will do stuff like EXPECT_EQ(report, expected_report).
They're all defined in the unittest because it and stats' operator==
is only used for testing.

See https://cs.chromium.org/chromium/src/testing/gtest/include/gtest/gtest-printers.h?sq=package:chromium&dr=C&rcl=1477394469&l=707

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2445343003
Cr-Commit-Position: refs/heads/master@{#14779}
This commit is contained in:
hbos 2016-10-25 10:55:08 -07:00 committed by Commit bot
parent d89ab145cd
commit da389e3518

View File

@ -11,6 +11,7 @@
#include "webrtc/api/rtcstatscollector.h"
#include <memory>
#include <ostream>
#include <string>
#include <vector>
@ -41,6 +42,35 @@ using testing::ReturnRef;
namespace webrtc {
// These are used by gtest code, such as if |EXPECT_EQ| fails.
void PrintTo(const RTCCertificateStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCDataChannelStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCIceCandidatePairStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCLocalIceCandidateStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCRemoteIceCandidateStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCPeerConnectionStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
void PrintTo(const RTCTransportStats& stats, ::std::ostream* os) {
*os << stats.ToString();
}
namespace {
const int64_t kGetStatsReportTimeoutMs = 1000;