Consolidate encoded transform mocks into api/test/

Includes removing the duplicate MockTransformableAudioFrame definition
in test/ in favour of the existing one in api/test/

Bug: webrtc:15802
Change-Id: Ib5f86b8b2095dd4e580cd9ff0038134f8a43cd93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336340
Auto-Submit: Tony Herre <herre@google.com>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41622}
This commit is contained in:
Tony Herre 2024-01-26 11:16:45 +01:00 committed by WebRTC LUCI CQ
parent 1dccfeb395
commit 9c6874607a
18 changed files with 32 additions and 85 deletions

View file

@ -1151,6 +1151,16 @@ if (rtc_include_tests) {
]
}
rtc_library("mock_frame_transformer") {
visibility = [ "*" ]
testonly = true
sources = [ "test/mock_frame_transformer.h" ]
deps = [
":frame_transformer_interface",
"../test:test_support",
]
}
rtc_library("mock_encoder_selector") {
visibility = [ "*" ]
testonly = true

View file

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_MOCK_FRAME_TRANSFORMER_H_
#define TEST_MOCK_FRAME_TRANSFORMER_H_
#ifndef API_TEST_MOCK_FRAME_TRANSFORMER_H_
#define API_TEST_MOCK_FRAME_TRANSFORMER_H_
#include <memory>
#include <vector>
@ -42,4 +42,4 @@ class MockFrameTransformer : public FrameTransformerInterface {
} // namespace webrtc
#endif // TEST_MOCK_FRAME_TRANSFORMER_H_
#endif // API_TEST_MOCK_FRAME_TRANSFORMER_H_

View file

@ -167,6 +167,8 @@ if (rtc_include_tests) {
"../api:mock_audio_mixer",
"../api:mock_frame_decryptor",
"../api:mock_frame_encryptor",
"../api:mock_frame_transformer",
"../api:mock_transformable_audio_frame",
"../api:scoped_refptr",
"../api/audio:audio_frame_api",
"../api/audio_codecs:audio_codecs_api",
@ -210,8 +212,6 @@ if (rtc_include_tests) {
"../system_wrappers",
"../test:audio_codec_mocks",
"../test:field_trial",
"../test:mock_frame_transformer",
"../test:mock_transformable_frame",
"../test:mock_transport",
"../test:rtp_test_utils",
"../test:run_loop",
@ -234,6 +234,7 @@ if (rtc_include_tests) {
sources = [ "channel_receive_unittest.cc" ]
deps = [
":audio",
"../api:mock_frame_transformer",
"../api/audio_codecs:builtin_audio_decoder_factory",
"../api/crypto:frame_decryptor_interface",
"../api/task_queue:default_task_queue_factory",
@ -245,7 +246,6 @@ if (rtc_include_tests) {
"../rtc_base:logging",
"../rtc_base:threading",
"../test:audio_codec_mocks",
"../test:mock_frame_transformer",
"../test:mock_transport",
"../test:test_support",
"../test/time_controller",

View file

@ -13,11 +13,11 @@
#include <memory>
#include <utility>
#include "api/test/mock_frame_transformer.h"
#include "api/test/mock_transformable_audio_frame.h"
#include "audio/channel_send_frame_transformer_delegate.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transformable_frame.h"
namespace webrtc {
namespace {

View file

@ -14,6 +14,7 @@
#include "api/audio_codecs/builtin_audio_decoder_factory.h"
#include "api/crypto/frame_decryptor_interface.h"
#include "api/task_queue/default_task_queue_factory.h"
#include "api/test/mock_frame_transformer.h"
#include "logging/rtc_event_log/mock/mock_rtc_event_log.h"
#include "modules/audio_device/include/audio_device.h"
#include "modules/audio_device/include/mock_audio_device.h"
@ -29,7 +30,6 @@
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_audio_decoder_factory.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transport.h"
#include "test/time_controller/simulated_time_controller.h"

View file

@ -15,11 +15,11 @@
#include <vector>
#include "absl/memory/memory.h"
#include "api/test/mock_frame_transformer.h"
#include "api/test/mock_transformable_audio_frame.h"
#include "rtc_base/task_queue_for_test.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transformable_frame.h"
namespace webrtc {
namespace {

View file

@ -17,12 +17,12 @@
#include "api/environment/environment.h"
#include "api/environment/environment_factory.h"
#include "api/scoped_refptr.h"
#include "api/test/mock_frame_transformer.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "call/rtp_transport_controller_send.h"
#include "rtc_base/gunit.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transport.h"
#include "test/scoped_key_value_config.h"
#include "test/time_controller/simulated_time_controller.h"

View file

@ -481,6 +481,7 @@ if (rtc_include_tests) {
"../api:array_view",
"../api:create_frame_generator",
"../api:mock_audio_mixer",
"../api:mock_frame_transformer",
"../api:rtp_headers",
"../api:rtp_parameters",
"../api:transport_api",
@ -525,7 +526,6 @@ if (rtc_include_tests) {
"../test:fake_video_codecs",
"../test:field_trial",
"../test:frame_generator_capturer",
"../test:mock_frame_transformer",
"../test:mock_transport",
"../test:run_loop",
"../test:scoped_key_value_config",

View file

@ -18,6 +18,7 @@
#include "absl/functional/any_invocable.h"
#include "api/environment/environment.h"
#include "api/environment/environment_factory.h"
#include "api/test/mock_frame_transformer.h"
#include "call/rtp_transport_controller_send.h"
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "modules/rtp_rtcp/source/byte_io.h"
@ -29,7 +30,6 @@
#include "rtc_base/rate_limiter.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transport.h"
#include "test/scenario/scenario.h"
#include "test/scoped_key_value_config.h"

View file

@ -652,6 +652,7 @@ if (rtc_include_tests) {
"../../api:frame_transformer_factory",
"../../api:make_ref_counted",
"../../api:mock_frame_encryptor",
"../../api:mock_frame_transformer",
"../../api:mock_transformable_video_frame",
"../../api:rtp_headers",
"../../api:rtp_packet_info",
@ -698,7 +699,6 @@ if (rtc_include_tests) {
"../../rtc_base:timeutils",
"../../system_wrappers",
"../../test:explicit_key_value_config",
"../../test:mock_frame_transformer",
"../../test:mock_transport",
"../../test:rtp_test_utils",
"../../test:run_loop",
@ -720,13 +720,13 @@ if (rtc_include_tests) {
sources = [ "source/frame_transformer_factory_unittest.cc" ]
deps = [
"../../api:frame_transformer_factory",
"../../api:mock_frame_transformer",
"../../api:mock_transformable_audio_frame",
"../../api:mock_transformable_video_frame",
"../../api:transport_api",
"../../call:video_stream_api",
"../../modules/rtp_rtcp",
"../../rtc_base:rtc_event",
"../../test:mock_frame_transformer",
"../../test:test_support",
"../../video",
]

View file

@ -17,6 +17,7 @@
#include "absl/memory/memory.h"
#include "api/call/transport.h"
#include "api/test/mock_frame_transformer.h"
#include "api/test/mock_transformable_audio_frame.h"
#include "api/test/mock_transformable_video_frame.h"
#include "call/video_receive_stream.h"
@ -24,7 +25,6 @@
#include "rtc_base/event.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
namespace webrtc {
namespace {

View file

@ -12,11 +12,11 @@
#include <utility>
#include "api/test/mock_frame_transformer.h"
#include "api/test/mock_transformable_video_frame.h"
#include "rtc_base/event.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/time_controller/simulated_time_controller.h"
namespace webrtc {

View file

@ -21,6 +21,7 @@
#include "api/task_queue/task_queue_base.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/test/mock_frame_encryptor.h"
#include "api/test/mock_frame_transformer.h"
#include "api/transport/rtp/dependency_descriptor.h"
#include "api/units/timestamp.h"
#include "api/video/video_codec_constants.h"
@ -46,7 +47,6 @@
#include "test/explicit_key_value_config.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/time_controller/simulated_time_controller.h"
namespace webrtc {

View file

@ -17,6 +17,7 @@
#include "absl/memory/memory.h"
#include "api/call/transport.h"
#include "api/test/mock_frame_transformer.h"
#include "api/test/mock_transformable_video_frame.h"
#include "api/units/timestamp.h"
#include "call/video_receive_stream.h"
@ -24,7 +25,6 @@
#include "rtc_base/event.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
namespace webrtc {
namespace {

View file

@ -1101,28 +1101,6 @@ rtc_source_set("test_renderer") {
}
}
rtc_library("mock_frame_transformer") {
visibility = [ "*" ]
testonly = true
sources = [ "mock_frame_transformer.h" ]
deps = [
"../api:frame_transformer_interface",
"../test:test_support",
]
}
rtc_library("mock_transformable_frame") {
visibility = [ "*" ]
testonly = true
sources = [ "mock_transformable_frame.h" ]
deps = [
"../api:frame_transformer_interface",
"../test:test_support",
]
}
if (is_mac) {
rtc_library("test_renderer_objc") {
testonly = true

View file

@ -1,41 +0,0 @@
/*
* Copyright (c) 2020 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.
*/
#ifndef TEST_MOCK_TRANSFORMABLE_FRAME_H_
#define TEST_MOCK_TRANSFORMABLE_FRAME_H_
#include "api/frame_transformer_interface.h"
#include "test/gmock.h"
namespace webrtc {
class MockTransformableAudioFrame : public TransformableAudioFrameInterface {
public:
MOCK_METHOD(rtc::ArrayView<const uint8_t>, GetData, (), (const, override));
MOCK_METHOD(rtc::ArrayView<const uint32_t>,
GetContributingSources,
(),
(const, override));
MOCK_METHOD(absl::optional<uint64_t>,
AbsoluteCaptureTimestamp,
(),
(const, override));
MOCK_METHOD(void, SetData, (rtc::ArrayView<const uint8_t>), (override));
MOCK_METHOD(uint8_t, GetPayloadType, (), (const, override));
MOCK_METHOD(uint32_t, GetSsrc, (), (const, override));
MOCK_METHOD(uint32_t, GetTimestamp, (), (const, override));
MOCK_METHOD(void, SetRTPTimestamp, (uint32_t), (override));
MOCK_METHOD(Direction, GetDirection, (), (const, override));
MOCK_METHOD(std::string, GetMimeType, (), (const, override));
};
} // namespace webrtc
#endif // TEST_MOCK_TRANSFORMABLE_FRAME_H_

View file

@ -830,6 +830,7 @@ if (rtc_include_tests) {
"../api:libjingle_peerconnection_api",
"../api:mock_fec_controller_override",
"../api:mock_frame_decryptor",
"../api:mock_frame_transformer",
"../api:mock_video_codec_factory",
"../api:mock_video_decoder",
"../api:mock_video_encoder",
@ -947,7 +948,6 @@ if (rtc_include_tests) {
"../test:fileutils",
"../test:frame_generator_capturer",
"../test:frame_utils",
"../test:mock_frame_transformer",
"../test:mock_transport",
"../test:null_transport",
"../test:rtp_test_utils",

View file

@ -14,6 +14,7 @@
#include <utility>
#include "api/task_queue/task_queue_base.h"
#include "api/test/mock_frame_transformer.h"
#include "api/video/video_codec_type.h"
#include "api/video/video_frame_type.h"
#include "call/test/mock_rtp_packet_sink_interface.h"
@ -35,7 +36,6 @@
#include "system_wrappers/include/clock.h"
#include "test/gmock.h"
#include "test/gtest.h"
#include "test/mock_frame_transformer.h"
#include "test/mock_transport.h"
#include "test/rtcp_packet_parser.h"
#include "test/scoped_key_value_config.h"