#include "chrome/browser/media/media_engagement_score.h"
#include <utility>
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial_param_associator.h"
#include "base/metrics/field_trial_params.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "media/base/media_switches.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
Optional;
base::Time GetReferenceTime() { … }
}
class MediaEngagementScoreTest : public ChromeRenderViewHostTestHarness { … };
class MediaEngagementScoreWithOverrideFieldTrialsTest
: public MediaEngagementScoreTest { … };
TEST_F(MediaEngagementScoreTest, MojoSerialization) { … }
TEST_F(MediaEngagementScoreTest, EmptyDictionary) { … }
TEST_F(MediaEngagementScoreTest, PartiallyEmptyDictionary) { … }
TEST_F(MediaEngagementScoreTest, PopulatedDictionary) { … }
TEST_F(MediaEngagementScoreTest, ContentSettingsMultiOrigin) { … }
TEST_F(MediaEngagementScoreTest, ContentSettings) { … }
TEST_F(MediaEngagementScoreTest, EngagementScoreCalculation) { … }
TEST_F(MediaEngagementScoreTest, HighScoreLegacy_High) { … }
TEST_F(MediaEngagementScoreTest, HighScoreLegacy_Low) { … }
TEST_F(MediaEngagementScoreTest, HighScoreUpdated) { … }
TEST_F(MediaEngagementScoreTest, HighScoreThreshold) { … }
TEST_F(MediaEngagementScoreTest, DefaultValues) { … }
TEST_F(MediaEngagementScoreWithOverrideFieldTrialsTest, OverrideFieldTrial) { … }
class MediaEngagementScoreWithHTTPSOnlyTest : public MediaEngagementScoreTest { … };
TEST_F(MediaEngagementScoreWithHTTPSOnlyTest, PopulatedDictionary_HTTPSOnly) { … }
TEST_F(MediaEngagementScoreTest, DoNotStoreDeprecatedFields) { … }