#include "media/mojo/services/watch_time_recorder.h"
#include <stddef.h>
#include <memory>
#include <string_view>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/hash/hash.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/test/test_message_loop.h"
#include "base/time/time.h"
#include "components/ukm/test_ukm_recorder.h"
#include "media/base/video_codecs.h"
#include "media/base/watch_time_keys.h"
#include "media/mojo/services/media_metrics_provider.h"
#include "mojo/public/cpp/bindings/remote.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"
UkmEntry;
namespace media {
constexpr char kTestOrigin[] = …;
class WatchTimeRecorderTest : public testing::Test { … };
TEST_F(WatchTimeRecorderTest, TestBasicReporting) { … }
TEST_F(WatchTimeRecorderTest, TestBasicReportingMediaStream) { … }
TEST_F(WatchTimeRecorderTest, TestRebufferingMetrics) { … }
TEST_F(WatchTimeRecorderTest, TestRebufferingMetricsMediaStream) { … }
TEST_F(WatchTimeRecorderTest, TestDiscardMetrics) { … }
TEST_F(WatchTimeRecorderTest, TestDiscardMetricsMediaStream) { … }
#define EXPECT_UKM …
#define EXPECT_NO_UKM …
#define EXPECT_HAS_UKM …
TEST_F(WatchTimeRecorderTest, TestFinalizeNoDuplication) { … }
TEST_F(WatchTimeRecorderTest, FinalizeWithoutWatchTime) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmAudioVideo) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmAudioVideoWithExtras) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmAudioVideoBackgroundMuted) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmAudioVideoDuration) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmAudioVideoDurationInfinite) { … }
TEST_F(WatchTimeRecorderTest, BasicUkmMediaStreamType) { … }
TEST_F(WatchTimeRecorderTest, NoSecondaryProperties) { … }
TEST_F(WatchTimeRecorderTest, SingleSecondaryPropertiesUnknownToKnown) { … }
TEST_F(WatchTimeRecorderTest, MultipleSecondaryPropertiesNoFinalize) { … }
TEST_F(WatchTimeRecorderTest, MultipleSecondaryPropertiesNoFinalizeNo2ndWT) { … }
TEST_F(WatchTimeRecorderTest, MultipleSecondaryPropertiesWithFinalize) { … }
TEST_F(WatchTimeRecorderTest, MultipleSecondaryPropertiesRebufferCarryover) { … }
#undef EXPECT_UKM
#undef EXPECT_NO_UKM
#undef EXPECT_HAS_UKM
}