#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 "components/ukm/test_ukm_recorder.h"
#include "media/base/key_systems.h"
#include "media/base/media_switches.h"
#include "media/capabilities/video_decode_stats_db.h"
#include "media/mojo/mojom/media_types.mojom.h"
#include "media/mojo/services/test_helpers.h"
#include "media/mojo/services/video_decode_perf_history.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
UkmEntry;
IsNull;
_;
namespace {
const bool kIsSmooth = …;
const bool kIsNotSmooth = …;
const bool kIsPowerEfficient = …;
const bool kIsNotPowerEfficient = …;
const bool kIsTopFrame = …;
const uint64_t kPlayerId = …;
}
namespace media {
class FakeVideoDecodeStatsDB : public VideoDecodeStatsDB { … };
class VideoDecodePerfHistoryTest : public testing::Test { … };
struct PerfHistoryTestParams { … };
class VideoDecodePerfHistoryParamTest
: public testing::WithParamInterface<PerfHistoryTestParams>,
public VideoDecodePerfHistoryTest { … };
TEST_P(VideoDecodePerfHistoryParamTest, GetPerfInfo_Smooth) { … }
TEST_P(VideoDecodePerfHistoryParamTest, GetPerfInfo_PowerEfficient) { … }
TEST_P(VideoDecodePerfHistoryParamTest, GetPerfInfo_FailedInitialize) { … }
TEST_P(VideoDecodePerfHistoryParamTest, AppendAndDestroyStats) { … }
TEST_P(VideoDecodePerfHistoryParamTest, GetVideoDecodeStatsDB) { … }
TEST_P(VideoDecodePerfHistoryParamTest,
GetVideoDecodeStatsDB_FailedInitialize) { … }
TEST_P(VideoDecodePerfHistoryParamTest, FailedDatabaseGetForAppend) { … }
TEST_P(VideoDecodePerfHistoryParamTest, FailedDatabaseAppend) { … }
TEST_P(VideoDecodePerfHistoryParamTest,
SmoothThresholdFinchOverride_NoEmeOverride) { … }
TEST_P(VideoDecodePerfHistoryParamTest,
SmoothThresholdFinchOverride_WithEmeOverride) { … }
const PerfHistoryTestParams kPerfHistoryTestParams[] = …;
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(VideoDecodePerfHistoryTest, ClearHistoryTriggersSuccessfulInitialize) { … }
TEST_F(VideoDecodePerfHistoryTest, ClearHistoryTriggersFailedInitialize) { … }
}