Chromium Code Reviews| 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..305b69b4ed67e83e1e7bcf0da892d1c53b54e45a |
| --- /dev/null |
| +++ b/webrtc/video/receive_statistics_proxy_unittest.cc |
| @@ -0,0 +1,45 @@ |
| +/* |
| + * 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 "webrtc/test/gtest.h" |
| + |
| +namespace webrtc { |
| + |
| +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_; |
| +}; |
|
hta-webrtc
2016/10/21 09:03:49
Can you add a TODO to increase test coverage of Re
sakal
2016/10/21 10:47:21
Done.
|
| + |
| +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 |