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

Unified Diff: webrtc/video/call_stats_unittest.cc

Issue 1915523002: Add a default implementation in metrics_default.cc of histograms methods in system_wrappers/interfac (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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/call_stats_unittest.cc
diff --git a/webrtc/video/call_stats_unittest.cc b/webrtc/video/call_stats_unittest.cc
index 6e2e1bca786108d2899353060e11d2b0cb6a45dd..f88e39ce615d60931bfc79bb625c6243ff45894f 100644
--- a/webrtc/video/call_stats_unittest.cc
+++ b/webrtc/video/call_stats_unittest.cc
@@ -15,8 +15,8 @@
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/system_wrappers/include/metrics.h"
+#include "webrtc/system_wrappers/include/metrics_default.h"
#include "webrtc/system_wrappers/include/tick_util.h"
-#include "webrtc/test/histogram.h"
#include "webrtc/video/call_stats.h"
using ::testing::_;
@@ -205,6 +205,8 @@ TEST_F(CallStatsTest, LastProcessedRtt) {
}
TEST_F(CallStatsTest, ProducesHistogramMetrics) {
+ metrics::Reset();
+ metrics::Enable();
const int64_t kRtt = 123;
RtcpRttStats* rtcp_rtt_stats = call_stats_->rtcp_rtt_stats();
rtcp_rtt_stats->OnRttUpdate(kRtt);
@@ -213,10 +215,10 @@ TEST_F(CallStatsTest, ProducesHistogramMetrics) {
call_stats_->Process();
call_stats_.reset();
- EXPECT_EQ(1, test::NumHistogramSamples(
+ EXPECT_EQ(1, metrics::NumSamples(
"WebRTC.Video.AverageRoundTripTimeInMilliseconds"));
- EXPECT_EQ(kRtt, test::LastHistogramSample(
- "WebRTC.Video.AverageRoundTripTimeInMilliseconds"));
+ EXPECT_EQ(1, metrics::NumEvents(
+ "WebRTC.Video.AverageRoundTripTimeInMilliseconds", kRtt));
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698