#include "chrome/browser/site_protection/site_protection_metrics_observer.h"
#include "base/metrics/statistics_recorder.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/engagement/site_engagement_service_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/safe_browsing/test_safe_browsing_service.h"
#include "chrome/browser/site_protection/site_familiarity_heuristic_name.h"
#include "chrome/browser/ui/safety_hub/mock_safe_browsing_database_manager.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/history_types.h"
#include "components/site_engagement/content/site_engagement_helper.h"
#include "components/site_engagement/content/site_engagement_service.h"
#include "content/public/test/test_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace site_protection {
namespace {
class TestSafeBrowsingDatabaseManager : public MockSafeBrowsingDatabaseManager { … };
}
class SiteProtectionMetricsObserverTest
: public ChromeRenderViewHostTestHarness { … };
TEST_F(SiteProtectionMetricsObserverTest, NoHistoryOlderThanADayAgo) { … }
TEST_F(SiteProtectionMetricsObserverTest, VisitInHistoryMoreThanADayAgo) { … }
TEST_F(SiteProtectionMetricsObserverTest, SiteEngagementScore) { … }
TEST_F(SiteProtectionMetricsObserverTest, IgnoreCurrentNavigationEngagement) { … }
TEST_F(SiteProtectionMetricsObserverTest, GlobalAllowlistMatch) { … }
}