#include <array>
#include <cstdint>
#include <iosfwd>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/containers/flat_set.h"
#include "base/feature_list.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial_params.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "chrome/browser/privacy_budget/identifiability_study_state.h"
#include "chrome/browser/privacy_budget/privacy_budget_browsertest_util.h"
#include "chrome/browser/privacy_budget/privacy_budget_prefs.h"
#include "chrome/common/privacy_budget/privacy_budget_features.h"
#include "chrome/common/privacy_budget/scoped_privacy_budget_config.h"
#include "chrome/common/privacy_budget/types.h"
#include "chrome/test/base/platform_browser_test.h"
#include "components/prefs/pref_service.h"
#include "components/ukm/test_ukm_recorder.h"
#include "components/ukm/ukm_recorder_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.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/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_surface.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_token.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h"
#include "url/gurl.h"
class Profile;
namespace ukm {
class UkmService;
}
namespace {
_;
AllOf;
Contains;
Each;
Field;
IsSupersetOf;
Key;
Pair;
UnorderedElementsAreArray;
MATCHER_P(Type, type, "") { … }
constexpr uint64_t HashFeature(const blink::mojom::WebFeature& feature) { … }
class EnableRandomSampling { … };
class PrivacyBudgetBrowserTestEnableRandomSampling
: private EnableRandomSampling,
public PlatformBrowserTest { … };
class PrivacyBudgetBrowserTestWithTestRecorder
: private EnableRandomSampling,
public PrivacyBudgetBrowserTestBaseWithTestRecorder { … };
}
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestEnableRandomSampling,
BrowserSideSettingsIsActive) { … }
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithTestRecorder, SamplingAPIs) { … }
IN_PROC_BROWSER_TEST_P(PrivacyBudgetBrowserTestWithTestRecorder,
RecordingFeaturesCalledInWorker) { … }
INSTANTIATE_TEST_SUITE_P(…);
namespace {
PrivacyBudgetBrowserTestForWorkersClientAdded;
}
IN_PROC_BROWSER_TEST_P(PrivacyBudgetBrowserTestForWorkersClientAdded,
WorkersRecordWorkerClientAddedMetrics) { … }
IN_PROC_BROWSER_TEST_P(PrivacyBudgetBrowserTestForWorkersClientAdded,
ReportWorkerClientAddedMetricForEveryRegisteredClient) { … }
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithTestRecorder,
EveryNavigationRecordsDocumentCreatedMetrics) { … }
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithTestRecorder,
CallsCanvasToBlob) { … }
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithTestRecorder,
CanvasToBlobDifferentDocument) { … }
namespace {
class PrivacyBudgetBrowserTestWithUkmRecording
: private EnableRandomSampling,
public PrivacyBudgetBrowserTestBaseWithUkmRecording { … };
}
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithUkmRecording,
UkmClientIdChangesResetStudyState) { … }
IN_PROC_BROWSER_TEST_F(PrivacyBudgetBrowserTestWithUkmRecording,
IncludesMetadata) { … }
namespace {
class PrivacyBudgetGroupConfigBrowserTest : public PlatformBrowserTest { … };
}
IN_PROC_BROWSER_TEST_F(PrivacyBudgetGroupConfigBrowserTest, LoadsAGroup) { … }
namespace {
class PrivacyBudgetAssignedBlockSamplingConfigTest
: public PlatformBrowserTest { … };
}
IN_PROC_BROWSER_TEST_F(PrivacyBudgetAssignedBlockSamplingConfigTest,
LoadsSettingsFromFieldTrialParameters) { … }
namespace {
class EnableMetaExperiment { … };
class PrivacyBudgetMetaExperimentBrowserTestWithUkmRecording
: private EnableMetaExperiment,
public PrivacyBudgetBrowserTestBaseWithUkmRecording { … };
class UkmRecorderAddEntryObserver : public ukm::UkmRecorderObserver { … };
}
IN_PROC_BROWSER_TEST_F(PrivacyBudgetMetaExperimentBrowserTestWithUkmRecording,
ReportsEncounteredSurfacesAndDocumentCreatedMetrics) { … }