chromium/third_party/blink/common/privacy_budget/identifiability_metric_builder_unittest.cc

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

#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"

#include <cinttypes>
#include <limits>
#include <string_view>

#include "base/strings/stringprintf.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/common/privacy_budget/test_ukm_recorder.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
#include "third_party/blink/public/common/privacy_budget/scoped_identifiability_test_sample_collector.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"

namespace blink {

TEST(IdentifiabilityMetricBuilderTest, Set) {}

TEST(IdentifiabilityMetricBuilderTest, BuilderOverload) {}

TEST(IdentifiabilityMetricBuilderTest, SetWebfeature) {}

namespace {

// clang flags this function as unused although it's used in the MATCHER_P()
// definition below. Hence the [[maybe_unused]].
[[maybe_unused]] bool HasSingleEntryWithValue(
    const test::ScopedIdentifiabilityTestSampleCollector& collector,
    int64_t value) {}

MATCHER_P(FirstMetricIs,
          entry,
          base::StringPrintf("entry is %s0x%" PRIx64,
                             negation ? "not " : "",
                             entry)) {}  // namespace

enum class Never {};

constexpr IdentifiableSurface kTestSurface =;

// Sample values
const char kAbcd[] =;
const int64_t kExpectedHashOfAbcd =;

// 5.1f
const int64_t kExpectedHashOfOnePointFive =;

}  // namespace

TEST(IdentifiabilityMetricBuilderTest, SetChar) {}

TEST(IdentifiabilityMetricBuilderTest, SetCharArray) {}

TEST(IdentifiabilityMetricBuilderTest, SetStringPiece) {}

TEST(IdentifiabilityMetricBuilderTest, SetStdString) {}

TEST(IdentifiabilityMetricBuilderTest, SetInt) {}

TEST(IdentifiabilityMetricBuilderTest, SetIntRef) {}

TEST(IdentifiabilityMetricBuilderTest, SetIntConstRef) {}

TEST(IdentifiabilityMetricBuilderTest, SetUnsigned) {}

TEST(IdentifiabilityMetricBuilderTest, SetUint64) {}

TEST(IdentifiabilityMetricBuilderTest, SetBigUnsignedInt) {}

TEST(IdentifiabilityMetricBuilderTest, SetFloat) {}

TEST(IdentifiabilityMetricBuilderTest, SetDouble) {}

TEST(IdentifiabilityMetricBuilderTest, SetEnum) {}

TEST(IdentifiabilityMetricBuilderTest, SetParameterPack) {}

}  // namespace blink