#include "third_party/blink/renderer/platform/peerconnection/resolution_monitor.h"
#include "base/compiler_specific.h"
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "media/base/decoder_buffer.h"
#include "media/base/test_data_util.h"
#include "media/parsers/ivf_parser.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
namespace {
const media::VideoCodec kCodecs[] = …;
class ResolutionMonitorTestWithInvalidFrame
: public ::testing::TestWithParam<media::VideoCodec> { … };
TEST_P(ResolutionMonitorTestWithInvalidFrame, ReturnNullOpt) { … }
INSTANTIATE_TEST_SUITE_P(…);
struct FrameData { … };
class ResolutionMonitorTestWithValidFrame
: public ::testing::TestWithParam<FrameData> { … };
TEST_P(ResolutionMonitorTestWithValidFrame, ReturnExpectedResolution) { … }
const FrameData kH264Frames[] = …;
const FrameData kVP8Frames[] = …;
const FrameData kVP9Frames[] = …;
const FrameData kAV1Frames[] = …;
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
std::vector<scoped_refptr<media::DecoderBuffer>> ReadIVF(const std::string& fname) { … }
struct VideoData { … };
class ResolutionMonitorTestWithValidVideo
: public ::testing::TestWithParam<VideoData> { … };
TEST_P(ResolutionMonitorTestWithValidVideo, ReturnExpectedResolution) { … }
const VideoData kVP8Videos[] = …;
const VideoData kVP9Videos[] = …;
const VideoData kAV1Videos[] = …;
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}
}