#include "components/commerce/core/compare/cluster_manager.h"
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/commerce_types.h"
#include "components/commerce/core/commerce_utils.h"
#include "components/commerce/core/compare/candidate_product.h"
#include "components/commerce/core/compare/cluster_server_proxy.h"
#include "components/commerce/core/compare/product_group.h"
#include "components/commerce/core/product_specifications/mock_product_specifications_service.h"
#include "components/commerce/core/product_specifications/product_specifications_service.h"
#include "components/commerce/core/product_specifications/product_specifications_set.h"
#include "components/commerce/core/proto/product_category.pb.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
_;
namespace commerce {
namespace {
static const uint64_t kProductID1 = …;
static const uint64_t kProductID2 = …;
static const uint64_t kProductID3 = …;
static const uint64_t kProductID4 = …;
static const uint64_t kProductID5 = …;
const std::string kTestUrl1 = …;
const std::string kTestUrl2 = …;
const std::string kTestUrl3 = …;
const std::string kProduct1Url = …;
const std::string kProduct2Url = …;
const std::string kCategoryLamp = …;
const std::string kCategoryChair = …;
const std::string kCategoryGamingChair = …;
const std::string kProductGroupName = …;
const std::string kClusterTitle = …;
class MockObserver : public ClusterManager::Observer { … };
class MockClusterServerProxy : public ClusterServerProxy { … };
}
class ClusterManagerTest : public testing::Test { … };
TEST_F(ClusterManagerTest, AddAndRemoveCandidateProduct) { … }
TEST_F(ClusterManagerTest,
ClusterManagerInitializationWithExistingProductSpecificationsSets) { … }
TEST_F(ClusterManagerTest, ClusterManagerInitialization_SkipInvalidSet) { … }
TEST_F(ClusterManagerTest, ClusterManagerInitialization_KickOffRemoving) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoForNavigation) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoForNavigationWithInvalidUrl) { … }
TEST_F(ClusterManagerTest,
GetEntryPointInfoForNavigationAfterRemoveingCandidateProduct) { … }
TEST_F(ClusterManagerTest, PrioritizeShortCategoryLabels) { … }
TEST_F(ClusterManagerTest,
CandidateProductRemovedBeforeGetProductInfoCompletes) { … }
TEST_F(ClusterManagerTest, FindSimilarCandidateProductsForProductGroup) { … }
TEST_F(ClusterManagerTest,
FindSimilarCandidateProductBeforeGetProductInfoCompletes) { … }
TEST_F(ClusterManagerTest,
FindSimilarCandidateProductWithProductsAlreadyInGroup) { … }
TEST_F(ClusterManagerTest,
FindSimilarCandidateProductForMultiLabelProductGroup) { … }
TEST_F(ClusterManagerTest,
FindSimilarCandidateProductsForProductGroupWithProductsAlreadyInGroup) { … }
TEST_F(ClusterManagerTest, RemoveProductGroup) { … }
TEST_F(ClusterManagerTest, GetProductGroupForCandidateProduct) { … }
TEST_F(ClusterManagerTest, GetProductGroupForCandidateProductAlreadyInGroup) { … }
TEST_F(ClusterManagerTest, MultipleSimilarProductGroupForCandidateProduct) { … }
TEST_F(ClusterManagerTest, AddCandidateProductAlreadyInProductGroups) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoForSelection) { … }
TEST_F(ClusterManagerTest,
GetEntryPointInfoForSelectionWithMultiLabelProducts) { … }
TEST_F(ClusterManagerTest, ClusterManagerObserver) { … }
TEST_F(ClusterManagerTest, TabClosedWhenGetComparableProducts) { … }
TEST_F(ClusterManagerTest, GetComparableProductsWithPartialProductsComparable) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoTitle_MostCommonBottomLabel) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoTitle_MostCommonLabel) { … }
TEST_F(ClusterManagerTest, GetEntryPointInfoTitle_SecondToBottomLabel) { … }
TEST_F(ClusterManagerTest, NoClusterForNonTriggerCategory) { … }
}