chromium/components/optimization_guide/core/model_quality/model_quality_logs_uploader_service_unittest.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/optimization_guide/core/model_quality/model_quality_logs_uploader_service.h"

#include <memory>
#include <optional>

#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test.pb.h"
#include "base/types/cxx23_to_underlying.h"
#include "components/optimization_guide/core/feature_registry/feature_registration.h"
#include "components/optimization_guide/core/model_execution/feature_keys.h"
#include "components/optimization_guide/core/model_execution/model_execution_prefs.h"
#include "components/optimization_guide/core/model_quality/feature_type_map.h"
#include "components/optimization_guide/core/model_quality/model_quality_log_entry.h"
#include "components/optimization_guide/core/optimization_guide_constants.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "components/optimization_guide/core/optimization_guide_switches.h"
#include "components/optimization_guide/core/optimization_guide_util.h"
#include "components/optimization_guide/proto/features/common_quality_data.pb.h"
#include "components/optimization_guide/proto/model_execution.pb.h"
#include "components/prefs/testing_pref_service.h"
#include "components/signin/public/base/consent_level.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "net/base/url_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace optimization_guide {

namespace {

std::unique_ptr<proto::LogAiDataRequest> BuildComposeLogAiDataReuqest() {}

}  // namespace

class ModelQualityLogsUploaderServiceTest : public testing::Test {};

TEST_F(ModelQualityLogsUploaderServiceTest, TestSuccessfulResponse) {}

TEST_F(ModelQualityLogsUploaderServiceTest, TestMultipleUploads) {}

TEST_F(ModelQualityLogsUploaderServiceTest, TestUploadWhenRequestIsEmpty) {}

TEST_F(ModelQualityLogsUploaderServiceTest, TestNetErrorResponse) {}

TEST_F(ModelQualityLogsUploaderServiceTest, TestBadResponse) {}

TEST_F(ModelQualityLogsUploaderServiceTest, WallpaperSearchUserFeedbackUMA) {}

TEST_F(ModelQualityLogsUploaderServiceTest, TabOrganizationUserFeedbackUMA) {}

TEST_F(ModelQualityLogsUploaderServiceTest,
       TabOrganizationUserFeedbackNullCheck) {}

TEST_F(ModelQualityLogsUploaderServiceTest,
       TabOrganizationMultipleOrganizationUserFeedbackUMA) {}

TEST_F(ModelQualityLogsUploaderServiceTest, ComposeUserFeedbackUMA) {}

TEST_F(ModelQualityLogsUploaderServiceTest, CheckUploadOnDestruction) {}

// TODO(b/301301447): Add more tests to cover all cases.

}  // namespace optimization_guide