chromium/components/commerce/core/shopping_service_metrics_unittest.cc

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

#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

namespace commerce {

class ShoppingServiceMetricsTest : public ShoppingServiceTestBase {};

TEST_F(ShoppingServiceMetricsTest,
       TestImageAvailabilityServerDisabledLocalEnabled) {}

TEST_F(ShoppingServiceMetricsTest,
       TestImageAvailabilityServerEnabledLocalDisabled) {}

TEST_F(ShoppingServiceMetricsTest, TestImageAvailabilityNoServerImage) {}

TEST_F(ShoppingServiceMetricsTest, TestImageAvailabilityNoLocalImage) {}

// In order for the metric to be recorded, the on-page javascripts needs to have
// run, otherwise we don't record as accurate of data. This test ensures that
// the metric isn't recorded if the javascript hasn't run.
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) {}

}  // namespace commerce