#include "base/sampling_heap_profiler/poisson_allocation_sampler.h"
#include <stdlib.h>
#include <array>
#include <atomic>
#include <bitset>
#include <memory>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/containers/extend.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/single_thread_task_runner_thread_mode.h"
#include "base/task/thread_pool.h"
#include "base/test/task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
AssertionFailure;
AssertionResult;
AssertionSuccess;
class DummySamplesObserver : public PoissonAllocationSampler::SamplesObserver { … };
class AddRemoveObserversTester { … };
class MuteHookedSamplesTester { … };
}
class PoissonAllocationSamplerStateTest : public ::testing::Test { … };
void AddRemoveObserversTester::Start(base::RepeatingClosure* barrier_closure,
int num_repetitions) { … }
void AddRemoveObserversTester::TestAddRemoveObservers(
base::RepeatingClosure* barrier_closure,
int remaining_repetitions) { … }
void MuteHookedSamplesTester::Start(base::RepeatingClosure* barrier_closure,
int num_repetitions) { … }
void MuteHookedSamplesTester::TestMuteUnmuteSamples(
base::RepeatingClosure* barrier_closure,
int remaining_repetitions) { … }
void PoissonAllocationSamplerStateTest::AddSamplesObservers(
DummySamplesObserver* observer1,
DummySamplesObserver* observer2) { … }
void PoissonAllocationSamplerStateTest::RemoveSamplesObservers(
DummySamplesObserver* observer1,
DummySamplesObserver* observer2) { … }
base::OnceClosure PoissonAllocationSamplerStateTest::MuteHookedSamples() { … }
void PoissonAllocationSamplerStateTest::UnmuteHookedSamples(
base::OnceClosure unmute_closure) { … }
TEST(PoissonAllocationSamplerTest, MuteHooksWithoutInit) { … }
TEST_F(PoissonAllocationSamplerStateTest, UpdateProfilingState) { … }
}