#include "components/segmentation_platform/internal/execution/model_manager_impl.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/metrics_hashes.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/gtest_util.h"
#include "base/test/mock_callback.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/segmentation_platform/internal/database/mock_signal_database.h"
#include "components/segmentation_platform/internal/database/signal_database.h"
#include "components/segmentation_platform/internal/database/test_segment_info_database.h"
#include "components/segmentation_platform/internal/execution/mock_model_provider.h"
#include "components/segmentation_platform/internal/execution/model_execution_status.h"
#include "components/segmentation_platform/internal/execution/model_manager.h"
#include "components/segmentation_platform/internal/execution/processing/feature_list_query_processor.h"
#include "components/segmentation_platform/internal/metadata/metadata_utils.h"
#include "components/segmentation_platform/public/model_provider.h"
#include "components/segmentation_platform/public/proto/aggregation.pb.h"
#include "components/segmentation_platform/public/proto/model_metadata.pb.h"
#include "components/segmentation_platform/public/proto/segmentation_platform.pb.h"
#include "components/segmentation_platform/public/proto/types.pb.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
RunOnceCallback;
_;
Invoke;
Return;
SaveArg;
SetArgReferee;
namespace segmentation_platform {
namespace {
const int64_t kOldModelVersion = …;
const int64_t kModelVersion = …;
constexpr SegmentId kSearchUserSegmentId = …;
constexpr SegmentId kPasswordManagerUserSegmentId = …;
Sample;
class MockSegmentInfoDatabase : public test::TestSegmentInfoDatabase { … };
}
class ModelManagerTest : public testing::Test { … };
TEST_F(ModelManagerTest, OnSegmentationModelUpdatedInvalidMetadata) { … }
TEST_F(ModelManagerTest, OnSegmentationModelUpdatedNoOldMetadata) { … }
TEST_F(
ModelManagerTest,
OnSegmentationModelUpdatedWithPreviousMetadataAndPredictionResultAndTrainingData) { … }
TEST_F(ModelManagerTest, DatabaseUpdateForDeletedServerModel) { … }
TEST_F(ModelManagerTest, DatabaseUpdateForDefaultModel) { … }
TEST_F(ModelManagerTest, GetModelProvider) { … }
}