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

Unified Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2423823003: Implement framesDecoded stat in video receive ssrc stats. (Closed)
Patch Set: Add #include <memory> to receive_statistics_proxy_unittest.cc. Created 4 years, 2 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/receive_statistics_proxy.cc ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy_unittest.cc
diff --git a/webrtc/video/receive_statistics_proxy_unittest.cc b/webrtc/video/receive_statistics_proxy_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..894ee8fe732ec837fdd31b2e57501fa11c4fe23f
--- /dev/null
+++ b/webrtc/video/receive_statistics_proxy_unittest.cc
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "webrtc/video/receive_statistics_proxy.h"
+
+#include <memory>
+
+#include "webrtc/test/gtest.h"
+
+namespace webrtc {
+
+// TODO(sakal): ReceiveStatisticsProxy is lacking unittesting.
+class ReceiveStatisticsProxyTest : public ::testing::Test {
+ public:
+ ReceiveStatisticsProxyTest() : fake_clock_(1234), config_(GetTestConfig()) {}
+ virtual ~ReceiveStatisticsProxyTest() {}
+
+ protected:
+ virtual void SetUp() {
+ statistics_proxy_.reset(new ReceiveStatisticsProxy(&config_, &fake_clock_));
+ }
+
+ VideoReceiveStream::Config GetTestConfig() {
+ VideoReceiveStream::Config config(nullptr);
+ return config;
+ }
+
+ SimulatedClock fake_clock_;
+ std::unique_ptr<ReceiveStatisticsProxy> statistics_proxy_;
+ VideoReceiveStream::Config config_;
+};
+
+TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesFramesDecoded) {
+ EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded);
+ for (uint32_t i = 1; i <= 3; ++i) {
+ statistics_proxy_->OnDecodedFrame();
+ EXPECT_EQ(i, statistics_proxy_->GetStats().frames_decoded);
+ }
+}
+
+} // namespace webrtc
« no previous file with comments | « webrtc/video/receive_statistics_proxy.cc ('k') | webrtc/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698