| 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..33d4ddde3c161a483e08afde4af22c7499d2196e
|
| --- /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_;
|
| +};
|
| +
|
| +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesFramesDecoded) {
|
| + EXPECT_EQ(0, statistics_proxy_->GetStats().frames_decoded);
|
| + for (int i = 1; i <= 3; ++i) {
|
| + statistics_proxy_->OnDecodedFrame();
|
| + EXPECT_EQ(i, statistics_proxy_->GetStats().frames_decoded);
|
| + }
|
| +}
|
| +
|
| +} // namespace webrtc
|
|
|