blob: 796ccda6bb335690b4379d8bcf547ce994fc7ff8 [file] [log] [blame]
Ilya Nikolaevskiyb0588e62018-08-27 12:12:271/*
2 * Copyright (c) 2018 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
Jonas Olssona4d87372019-07-05 17:08:3311#include "test/fake_vp8_encoder.h"
12
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2713#include <memory>
14#include <utility>
15
16#include "absl/memory/memory.h"
17#include "api/test/create_simulcast_test_fixture.h"
18#include "api/test/simulcast_test_fixture.h"
Danil Chapovalov99b71df2018-10-26 13:57:4819#include "api/test/video/function_video_decoder_factory.h"
20#include "api/test/video/function_video_encoder_factory.h"
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2721#include "modules/video_coding/utility/simulcast_test_fixture_impl.h"
Per Kjellander841c9122018-10-04 16:40:2822#include "test/fake_vp8_decoder.h"
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2723
24namespace webrtc {
25namespace test {
26
27namespace {
28
29std::unique_ptr<SimulcastTestFixture> CreateSpecificSimulcastTestFixture() {
30 std::unique_ptr<VideoEncoderFactory> encoder_factory =
31 absl::make_unique<FunctionVideoEncoderFactory>([]() {
32 return absl::make_unique<FakeVP8Encoder>(Clock::GetRealTimeClock());
33 });
34 std::unique_ptr<VideoDecoderFactory> decoder_factory =
35 absl::make_unique<FunctionVideoDecoderFactory>(
Per Kjellander841c9122018-10-04 16:40:2836 []() { return absl::make_unique<FakeVp8Decoder>(); });
Ilya Nikolaevskiyb0588e62018-08-27 12:12:2737 return CreateSimulcastTestFixture(std::move(encoder_factory),
38 std::move(decoder_factory),
39 SdpVideoFormat("VP8"));
40}
41} // namespace
42
43TEST(TestFakeVp8Codec, TestKeyFrameRequestsOnAllStreams) {
44 auto fixture = CreateSpecificSimulcastTestFixture();
45 fixture->TestKeyFrameRequestsOnAllStreams();
46}
47
48TEST(TestFakeVp8Codec, TestPaddingAllStreams) {
49 auto fixture = CreateSpecificSimulcastTestFixture();
50 fixture->TestPaddingAllStreams();
51}
52
53TEST(TestFakeVp8Codec, TestPaddingTwoStreams) {
54 auto fixture = CreateSpecificSimulcastTestFixture();
55 fixture->TestPaddingTwoStreams();
56}
57
58TEST(TestFakeVp8Codec, TestPaddingTwoStreamsOneMaxedOut) {
59 auto fixture = CreateSpecificSimulcastTestFixture();
60 fixture->TestPaddingTwoStreamsOneMaxedOut();
61}
62
63TEST(TestFakeVp8Codec, TestPaddingOneStream) {
64 auto fixture = CreateSpecificSimulcastTestFixture();
65 fixture->TestPaddingOneStream();
66}
67
68TEST(TestFakeVp8Codec, TestPaddingOneStreamTwoMaxedOut) {
69 auto fixture = CreateSpecificSimulcastTestFixture();
70 fixture->TestPaddingOneStreamTwoMaxedOut();
71}
72
73TEST(TestFakeVp8Codec, TestSendAllStreams) {
74 auto fixture = CreateSpecificSimulcastTestFixture();
75 fixture->TestSendAllStreams();
76}
77
78TEST(TestFakeVp8Codec, TestDisablingStreams) {
79 auto fixture = CreateSpecificSimulcastTestFixture();
80 fixture->TestDisablingStreams();
81}
82
83TEST(TestFakeVp8Codec, TestSwitchingToOneStream) {
84 auto fixture = CreateSpecificSimulcastTestFixture();
85 fixture->TestSwitchingToOneStream();
86}
87
88TEST(TestFakeVp8Codec, TestSwitchingToOneOddStream) {
89 auto fixture = CreateSpecificSimulcastTestFixture();
90 fixture->TestSwitchingToOneOddStream();
91}
92
93TEST(TestFakeVp8Codec, TestSwitchingToOneSmallStream) {
94 auto fixture = CreateSpecificSimulcastTestFixture();
95 fixture->TestSwitchingToOneSmallStream();
96}
97
98TEST(TestFakeVp8Codec, TestSpatioTemporalLayers333PatternEncoder) {
99 auto fixture = CreateSpecificSimulcastTestFixture();
100 fixture->TestSpatioTemporalLayers333PatternEncoder();
101}
102
Per Kjellander841c9122018-10-04 16:40:28103TEST(TestFakeVp8Codec, TestDecodeWidthHeightSet) {
104 auto fixture = CreateSpecificSimulcastTestFixture();
105 fixture->TestDecodeWidthHeightSet();
106}
107
Ilya Nikolaevskiyb0588e62018-08-27 12:12:27108} // namespace test
109} // namespace webrtc