#include "components/segmentation_platform/internal/selection/request_dispatcher.h"
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/simple_test_clock.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
#include "components/segmentation_platform/internal/constants.h"
#include "components/segmentation_platform/internal/database/cached_result_writer.h"
#include "components/segmentation_platform/internal/database/config_holder.h"
#include "components/segmentation_platform/internal/database/signal_database.h"
#include "components/segmentation_platform/internal/database/signal_storage_config.h"
#include "components/segmentation_platform/internal/database/storage_service.h"
#include "components/segmentation_platform/internal/metadata/metadata_utils.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/internal/mock_ukm_data_manager.h"
#include "components/segmentation_platform/internal/post_processor/post_processing_test_utils.h"
#include "components/segmentation_platform/internal/selection/request_handler.h"
#include "components/segmentation_platform/internal/selection/segment_result_provider.h"
#include "components/segmentation_platform/public/config.h"
#include "components/segmentation_platform/public/prediction_options.h"
#include "components/segmentation_platform/public/proto/prediction_result.pb.h"
#include "components/segmentation_platform/public/result.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Invoke;
namespace segmentation_platform {
namespace {
const char kDeviceSwitcherClient[] = …;
const char kAdaptiveToolbarClient[] = …;
const char kTestLabel1[] = …;
const char kTestLabel2[] = …;
proto::PredictionResult CreatePredictionResultWithBinaryClassifier(
const char* const label) { … }
proto::PredictionResult CreatePredictionResultWithGenericPredictor() { … }
class MockRequestHandler : public RequestHandler { … };
class RequestDispatcherTest : public testing::Test { … };
TEST_F(RequestDispatcherTest, TestRequestQueuingWithInitFailure) { … }
TEST_F(RequestDispatcherTest,
TestRequestQueuingWithInitSuccessAndNoModelsLoading) { … }
TEST_F(RequestDispatcherTest,
TestRequestQueuingWithInitSuccessAndAfterModelsLoaded) { … }
TEST_F(RequestDispatcherTest, TestRequestAfterInitSuccessAndModelsLoaded) { … }
TEST_F(RequestDispatcherTest, TestAnnotatedNumericResultRequestWithWaiting) { … }
TEST_F(RequestDispatcherTest, TestOnDemandWithFallback) { … }
TEST_F(RequestDispatcherTest, TestCachedExecutionWithoutFallback) { … }
TEST_F(RequestDispatcherTest, TestCachedExecutionWithFallback) { … }
}
}