#include "components/optimization_guide/core/prediction_model_store.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/rand_util.h"
#include "base/task/thread_pool.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/uuid.h"
#include "components/optimization_guide/core/model_enums.h"
#include "components/optimization_guide/core/model_store_metadata_entry.h"
#include "components/optimization_guide/core/model_util.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/optimization_guide_prefs.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/optimization_guide/proto/models.pb.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace optimization_guide {
namespace {
const proto::OptimizationTarget kTestOptimizationTargetFoo = …;
const proto::OptimizationTarget kTestOptimizationTargetBar = …;
const char kTestLocaleFoo[] = …;
const char kTestLocaleBar[] = …;
proto::ModelCacheKey CreateModelCacheKey(const std::string& locale) { … }
struct ModelDetail { … };
}
class TestPredictionModelStore : public PredictionModelStore { … };
class PredictionModelStoreTest : public testing::Test { … };
TEST_F(PredictionModelStoreTest, BaseModelDirs) { … }
TEST_F(PredictionModelStoreTest, ModelUpdateAndLoad) { … }
TEST_F(PredictionModelStoreTest, ModelWithAdditionalFile) { … }
TEST_F(PredictionModelStoreTest, InvalidModelAdditionalFile) { … }
TEST_F(PredictionModelStoreTest, ModelsSharedBasedOnServerModelCacheKey) { … }
TEST_F(PredictionModelStoreTest, UpdateMetadataForExistingModel) { … }
TEST_F(PredictionModelStoreTest, ModelStorageMetrics) { … }
TEST_F(PredictionModelStoreTest, ExpiredModelRemoved) { … }
TEST_F(PredictionModelStoreTest, ExpiredModelRemovedOnLoadModel) { … }
TEST_F(PredictionModelStoreTest, OldModelRemovedOnNewModelUpdate) { … }
TEST_F(PredictionModelStoreTest, InvalidModelDirModelRemoved) { … }
TEST_F(PredictionModelStoreTest, InvalidModelDirModelUpdate) { … }
TEST_F(PredictionModelStoreTest, InconsistentModelDirsRemoved) { … }
TEST_F(PredictionModelStoreTest, InconsistentOptTargetDirsRemoved) { … }
}