#include "chrome/browser/segmentation_platform/ukm_data_manager_test_utils.h"
#include "base/run_loop.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/segmentation_platform/segmentation_platform_service_factory.h"
#include "chrome/browser/segmentation_platform/ukm_database_client.h"
#include "components/history/core/browser/history_service.h"
#include "components/segmentation_platform/embedder/model_provider_factory_impl.h"
#include "components/segmentation_platform/internal/database/ukm_database.h"
#include "components/segmentation_platform/internal/execution/mock_model_provider.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/internal/segmentation_platform_service_impl.h"
#include "components/segmentation_platform/internal/signals/ukm_observer.h"
#include "components/segmentation_platform/internal/ukm_data_manager.h"
#include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace segmentation_platform {
namespace {
SegmentId;
Return;
PageLoad;
ukm::mojom::UkmEntryPtr GetSamplePageLoadEntry(ukm::SourceId source_id) { … }
std::optional<float> RunQueryAndGetResult(UkmDatabase* database,
UkmDatabase::CustomSqlQuery&& query) { … }
}
UkmDataManagerTestUtils::UkmDataManagerTestUtils(
ukm::TestUkmRecorder* ukm_recorder,
bool owned_db_client)
: … { … }
UkmDataManagerTestUtils::~UkmDataManagerTestUtils() { … }
void UkmDataManagerTestUtils::PreProfileInit(
const std::map<SegmentId, proto::SegmentationModelMetadata>&
default_overrides) { … }
void UkmDataManagerTestUtils::SetupForProfile(Profile* profile) { … }
void UkmDataManagerTestUtils::WillDestroyProfile(Profile* profile) { … }
void UkmDataManagerTestUtils::WaitForUkmObserverRegistration() { … }
proto::SegmentationModelMetadata
UkmDataManagerTestUtils::GetSamplePageLoadMetadata(const std::string& query) { … }
void UkmDataManagerTestUtils::RecordPageLoadUkm(const GURL& url,
base::Time history_timestamp) { … }
bool UkmDataManagerTestUtils::IsUrlInDatabase(const GURL& url) { … }
MockDefaultModelProvider* UkmDataManagerTestUtils::GetDefaultOverride(
proto::SegmentId segment_id) { … }
}