#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <map>
#include "base/metrics/field_trial.h"
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/statistics_recorder.h"
#include "base/test/metrics/user_action_tester.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "content/public/test/browser_test.h"
namespace extensions {
namespace {
struct RecordedUserAction { … } g_user_actions[] = …;
struct RecordedHistogram { … } g_histograms[] = …;
struct Bucket { … };
struct SparseHistogram { … } g_sparse_histograms[] = …;
void ValidateUserActions(const base::UserActionTester& user_action_tester,
const RecordedUserAction* recorded,
int count) { … }
void ValidateSparseHistogramSamples(
const std::string& name,
const base::HistogramSamples& samples) { … }
void ValidateHistograms(const RecordedHistogram* recorded,
int count) { … }
}
ContextType;
class ExtensionMetricsApiTest
: public ExtensionApiTest,
public testing::WithParamInterface<ContextType> { … };
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(ExtensionMetricsApiTest, Metrics) { … }
}