OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/video/encoder_rtcp_feedback.h" | 11 #include "webrtc/video/encoder_rtcp_feedback.h" |
12 | 12 |
| 13 #include <memory> |
| 14 |
13 #include "webrtc/modules/utility/include/mock/mock_process_thread.h" | 15 #include "webrtc/modules/utility/include/mock/mock_process_thread.h" |
14 #include "webrtc/test/gmock.h" | 16 #include "webrtc/test/gmock.h" |
15 #include "webrtc/test/gtest.h" | 17 #include "webrtc/test/gtest.h" |
16 #include "webrtc/video/send_statistics_proxy.h" | 18 #include "webrtc/video/send_statistics_proxy.h" |
17 #include "webrtc/video/vie_encoder.h" | 19 #include "webrtc/video/vie_encoder.h" |
18 | 20 |
19 using ::testing::NiceMock; | 21 using ::testing::NiceMock; |
20 | 22 |
21 namespace webrtc { | 23 namespace webrtc { |
22 | 24 |
23 class MockVieEncoder : public ViEEncoder { | 25 class MockVieEncoder : public ViEEncoder { |
24 public: | 26 public: |
25 explicit MockVieEncoder(SendStatisticsProxy* send_stats_proxy) | 27 explicit MockVieEncoder(SendStatisticsProxy* send_stats_proxy) |
26 : ViEEncoder(1, | 28 : ViEEncoder(1, |
27 send_stats_proxy, | 29 send_stats_proxy, |
28 VideoSendStream::Config::EncoderSettings("fake", 0, nullptr), | 30 VideoSendStream::Config::EncoderSettings("fake", 0, nullptr), |
29 nullptr, | 31 nullptr, |
30 nullptr) {} | 32 nullptr, |
| 33 std::unique_ptr<OveruseFrameDetector>()) {} |
31 ~MockVieEncoder() { Stop(); } | 34 ~MockVieEncoder() { Stop(); } |
32 | 35 |
33 MOCK_METHOD1(OnReceivedIntraFrameRequest, void(size_t)); | 36 MOCK_METHOD1(OnReceivedIntraFrameRequest, void(size_t)); |
34 }; | 37 }; |
35 | 38 |
36 class VieKeyRequestTest : public ::testing::Test { | 39 class VieKeyRequestTest : public ::testing::Test { |
37 public: | 40 public: |
38 VieKeyRequestTest() | 41 VieKeyRequestTest() |
39 : simulated_clock_(123456789), | 42 : simulated_clock_(123456789), |
40 send_stats_proxy_(&simulated_clock_, | 43 send_stats_proxy_(&simulated_clock_, |
(...skipping 27 matching lines...) Expand all Loading... |
68 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); | 71 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); |
69 | 72 |
70 EXPECT_CALL(encoder_, OnReceivedIntraFrameRequest(0)).Times(1); | 73 EXPECT_CALL(encoder_, OnReceivedIntraFrameRequest(0)).Times(1); |
71 simulated_clock_.AdvanceTimeMilliseconds(300); | 74 simulated_clock_.AdvanceTimeMilliseconds(300); |
72 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); | 75 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); |
73 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); | 76 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); |
74 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); | 77 encoder_rtcp_feedback_.OnReceivedIntraFrameRequest(kSsrc); |
75 } | 78 } |
76 | 79 |
77 } // namespace webrtc | 80 } // namespace webrtc |
OLD | NEW |