#include "components/history_embeddings/ml_embedder.h"
#include <memory>
#include "base/path_service.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "components/history_embeddings/passage_embeddings_service_controller.h"
#include "components/history_embeddings/vector_database.h"
#include "components/optimization_guide/core/test_model_info_builder.h"
#include "components/optimization_guide/core/test_optimization_guide_model_provider.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/passage_embeddings/public/mojom/passage_embeddings.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace history_embeddings {
namespace {
constexpr int64_t kEmbeddingsModelVersion = …;
constexpr uint32_t kEmbeddingsModelInputWindowSize = …;
constexpr size_t kEmbeddingsModelOutputSize = …;
optimization_guide::TestModelInfoBuilder GetBuilderWithValidModelInfo() { … }
class FakePassageEmbedder : public passage_embeddings::mojom::PassageEmbedder { … };
class FakePassageEmbeddingsService
: public passage_embeddings::mojom::PassageEmbeddingsService { … };
class FakePassageEmbeddingsServiceController
: public PassageEmbeddingsServiceController { … };
class TestOptimizationGuideModelProvider
: public optimization_guide::TestOptimizationGuideModelProvider { … };
}
class MlEmbedderTest : public testing::Test { … };
TEST_F(MlEmbedderTest, RegistersForTarget) { … }
TEST_F(MlEmbedderTest, ReceivesValidModelInfo) { … }
TEST_F(MlEmbedderTest, ReceivesEmptyModelInfo) { … }
TEST_F(MlEmbedderTest, ReceivesModelInfoWithInvalidModelMetadata) { … }
TEST_F(MlEmbedderTest, ReceivesModelInfoWithoutModelMetadata) { … }
TEST_F(MlEmbedderTest, ReceivesModelInfoWithoutAdditionalFiles) { … }
TEST_F(MlEmbedderTest, GeneratesEmbeddings) { … }
TEST_F(MlEmbedderTest, ReturnsModelUnavailableErrorIfModelInfoNotValid) { … }
TEST_F(MlEmbedderTest, ReturnsExecutionFailure) { … }
}