#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 {
[[maybe_unused]] bool HasSingleEntryWithValue(
const test::ScopedIdentifiabilityTestSampleCollector& collector,
int64_t value) { … }
MATCHER_P(FirstMetricIs,
entry,
base::StringPrintf("entry is %s0x%" PRIx64,
negation ? "not " : "",
entry)) { … }
enum class Never { … };
constexpr IdentifiableSurface kTestSurface = …;
const char kAbcd[] = …;
const int64_t kExpectedHashOfAbcd = …;
const int64_t kExpectedHashOfOnePointFive = …;
}
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) { … }
}