#include <memory>
#include "base/functional/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/values.h"
#include "components/commerce/core/commerce_constants.h"
#include "components/commerce/core/commerce_feature_list.h"
#include "components/commerce/core/metrics/metrics_utils.h"
#include "components/commerce/core/shopping_service.h"
#include "components/commerce/core/shopping_service_test_base.h"
#include "components/optimization_guide/core/optimization_guide_decider.h"
#include "components/optimization_guide/core/optimization_guide_decision.h"
#include "components/optimization_guide/core/optimization_metadata.h"
#include "components/optimization_guide/proto/hints.pb.h"
#include "components/ukm/test_ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
OptimizationGuideDecision;
OptimizationGuideDecisionCallback;
OptimizationMetadata;
Any;
OptimizationType;
UkmEntry;
namespace {
const char kProductUrl[] = …;
const char kImageUrl[] = …;
const char kImageUrl2[] = …;
}
namespace commerce {
class ShoppingServiceMetricsTest : public ShoppingServiceTestBase { … };
TEST_F(ShoppingServiceMetricsTest,
TestImageAvailabilityServerDisabledLocalEnabled) { … }
TEST_F(ShoppingServiceMetricsTest,
TestImageAvailabilityServerEnabledLocalDisabled) { … }
TEST_F(ShoppingServiceMetricsTest, TestImageAvailabilityNoServerImage) { … }
TEST_F(ShoppingServiceMetricsTest, TestImageAvailabilityNoLocalImage) { … }
TEST_F(ShoppingServiceMetricsTest, TestImageAvailabilityNoRecordIfJSNotRun) { … }
TEST_F(ShoppingServiceMetricsTest, TestLocalPDPDetection_NoLocal) { … }
TEST_F(ShoppingServiceMetricsTest, TestLocalPDPDetection_BothServerAndLocal) { … }
TEST_F(ShoppingServiceMetricsTest, TestLocalPDPDetection_NoServer) { … }
TEST_F(ShoppingServiceMetricsTest, TestLocalPDPDetection_IllegalScheme) { … }
TEST_F(ShoppingServiceMetricsTest,
TestLocalPDPDetection_NoServer_NoExperimentFlag) { … }
TEST_F(ShoppingServiceMetricsTest, TestProductInfoJsExecutionTime) { … }
TEST_F(ShoppingServiceMetricsTest, TestNoExtractionForNonShoppingPage) { … }
}