#include "components/segmentation_platform/internal/signals/ukm_observer.h"
#include <memory>
#include "base/test/task_environment.h"
#include "components/prefs/testing_pref_service.h"
#include "components/segmentation_platform/internal/constants.h"
#include "components/segmentation_platform/internal/database/mock_ukm_database.h"
#include "components/segmentation_platform/internal/signals/ukm_config.h"
#include "components/segmentation_platform/internal/signals/url_signal_handler.h"
#include "components/segmentation_platform/internal/ukm_data_manager_impl.h"
#include "components/segmentation_platform/public/local_state_helper.h"
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace segmentation_platform {
namespace {
_;
Invoke;
UnorderedElementsAre;
PageLoad;
PaintPreviewCapture;
constexpr ukm::SourceId kSourceId = …;
ukm::mojom::UkmEntryPtr GetSamplePageLoadEntry(
ukm::SourceId source_id = kSourceId) { … }
ukm::mojom::UkmEntryPtr GetSamplePaintPreviewEntry(
ukm::SourceId source_id = kSourceId) { … }
UkmEventHash TestEvent(uint64_t hash) { … }
UkmMetricHash TestMetric(uint64_t hash) { … }
}
class UkmObserverTest : public testing::Test { … };
TEST_F(UkmObserverTest, EmptyConfig) { … }
TEST_F(UkmObserverTest, FilterEventsAndMetrics) { … }
TEST_F(UkmObserverTest, PauseObservation) { … }
TEST_F(UkmObserverTest, ObservationFromRecorder) { … }
TEST_F(UkmObserverTest, GetUkmMostRecentAllowedTime) { … }
}