#include "third_party/blink/common/privacy_budget/aggregating_sample_collector.h"
#include <memory>
#include <type_traits>
#include <vector>
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/metrics/public/mojom/ukm_interface.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/common/privacy_budget/identifiability_sample_collector_test_utils.h"
#include "third_party/blink/common/privacy_budget/test_ukm_recorder.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_sample_collector.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings_provider.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_sample.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
namespace {
Pointee;
UnorderedElementsAre;
}
namespace blink {
namespace {
constexpr ukm::SourceId kTestSource1 = …;
constexpr ukm::SourceId kTestSource2 = …;
constexpr IdentifiableSurface kTestSurface1 = …;
constexpr IdentifiableSurface kTestSurface2 = …;
constexpr IdentifiableToken kTestValue1 = …;
class TestSettingsProvider : public IdentifiabilityStudySettingsProvider { … };
}
class AggregatingSampleCollectorTest : public ::testing::Test { … };
TEST_F(AggregatingSampleCollectorTest, NoImmediatePassthrough) { … }
TEST_F(AggregatingSampleCollectorTest, MergesDuplicates) { … }
TEST_F(AggregatingSampleCollectorTest, DoesNotCountDuplicates) { … }
TEST_F(AggregatingSampleCollectorTest, TooManySurfaces) { … }
TEST_F(AggregatingSampleCollectorTest, TooManySources) { … }
TEST_F(AggregatingSampleCollectorTest, TooManySamplesPerSurface) { … }
TEST_F(AggregatingSampleCollectorTest, TooManyUnsentMetrics) { … }
TEST_F(AggregatingSampleCollectorTest, TooManyUnsentSources) { … }
TEST_F(AggregatingSampleCollectorTest, UnsentMetricsAreTooOld) { … }
TEST_F(AggregatingSampleCollectorTest, FlushSource) { … }
TEST_F(AggregatingSampleCollectorTest, GlobalInstance) { … }
TEST_F(AggregatingSampleCollectorTest, NullRecorder) { … }
TEST_F(AggregatingSampleCollectorTest, InvalidSourceId) { … }
}