OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/video/receive_statistics_proxy.h" | |
12 | |
13 #include "webrtc/test/gtest.h" | |
14 | |
15 namespace webrtc { | |
16 | |
17 class ReceiveStatisticsProxyTest : public ::testing::Test { | |
18 public: | |
19 ReceiveStatisticsProxyTest() : fake_clock_(1234), config_(GetTestConfig()) {} | |
20 virtual ~ReceiveStatisticsProxyTest() {} | |
21 | |
22 protected: | |
23 virtual void SetUp() { | |
24 statistics_proxy_.reset(new ReceiveStatisticsProxy(&config_, &fake_clock_)); | |
25 } | |
26 | |
27 VideoReceiveStream::Config GetTestConfig() { | |
28 VideoReceiveStream::Config config(nullptr); | |
29 return config; | |
30 } | |
31 | |
32 SimulatedClock fake_clock_; | |
33 std::unique_ptr<ReceiveStatisticsProxy> statistics_proxy_; | |
34 VideoReceiveStream::Config config_; | |
35 }; | |
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.
| |
36 | |
37 TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesFramesDecoded) { | |
38 EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded); | |
39 for (uint32_t i = 1; i <= 3; ++i) { | |
40 statistics_proxy_->OnDecodedFrame(); | |
41 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_decoded); | |
42 } | |
43 } | |
44 | |
45 } // namespace webrtc | |
OLD | NEW |