#include <map>
#include <memory>
#include <string>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "media/base/media_switches.h"
#include "media/capabilities/webrtc_video_stats_db.h"
#include "media/mojo/mojom/media_types.mojom.h"
#include "media/mojo/services/webrtc_video_perf_history.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
IsNull;
namespace media {
namespace {
constexpr bool kIsDecode = …;
constexpr bool kIsEncode = …;
constexpr bool kHardware = …;
constexpr bool kSoftware = …;
constexpr bool kIsSmooth = …;
constexpr bool kIsNotSmooth = …;
constexpr VideoCodecProfile kKnownProfile = …;
constexpr int32_t kPixelsHd = …;
constexpr int32_t kPixelsFullHd = …;
constexpr int32_t kPixels4K = …;
constexpr int kFramesProcessed = …;
constexpr int kKeyFramesProcessed = …;
}
class FakeWebrtcVideoStatsDB : public WebrtcVideoStatsDB { … };
class WebrtcVideoPerfHistoryTest : public testing::Test { … };
struct WebrtcPerfHistoryTestParams { … };
class WebrtcVideoPerfHistoryParamTest
: public testing::WithParamInterface<WebrtcPerfHistoryTestParams>,
public WebrtcVideoPerfHistoryTest { … };
TEST_P(WebrtcVideoPerfHistoryParamTest, GetPerfInfo) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest,
GetPerfInfoSmoothnessThresholdOverride) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetPerfInfoCombinedPrediction) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest,
GetPerfInfoSmoothDecisionRatioThresholdOverride) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetPerfInfoFrameRateBucketing) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, OnlySaveValidKeysAndStats) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, SmoothIsTrueForUntrackedCodecProfiles) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetPerfInfoFailedInitialize) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, AppendAndDestroyStats) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetWebrtcVideoStatsDB) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetWebrtcVideoStatsDBFailedInitialize) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, FailedDatabaseGetForAppend) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, FailedDatabaseAppend) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest, GetPerfInfo4KSmoothImpliesHdSmooth) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest,
GetPerfInfoFullHdNotSmoothImplies4KNotSmooth) { … }
TEST_P(WebrtcVideoPerfHistoryParamTest,
GetPerfInfoFullHdSmoothEvenIf4KNotSmooth) { … }
const WebrtcPerfHistoryTestParams kWebrtcPerfHistoryTestParams[] = …;
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(WebrtcVideoPerfHistoryTest, ClearHistoryTriggersSuccessfulInitialize) { … }
TEST_F(WebrtcVideoPerfHistoryTest, ClearHistoryTriggersFailedInitialize) { … }
}