#include "base/allocator/dispatcher/dispatcher.h"
#include "base/allocator/dispatcher/configuration.h"
#include "base/allocator/dispatcher/notification_data.h"
#include "base/allocator/dispatcher/testing/dispatcher_test.h"
#include "base/allocator/dispatcher/testing/tools.h"
#include "build/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_root.h"
#include "testing/gtest/include/gtest/gtest.h"
#if PA_BUILDFLAG(USE_PARTITION_ALLOC)
#include "partition_alloc/partition_alloc_for_testing.h"
#endif
#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
#include "partition_alloc/shim/allocator_shim.h"
#endif
#include <tuple>
namespace base::allocator::dispatcher {
namespace {
kMaximumNumberOfObservers;
kMaximumNumberOfOptionalObservers;
PartitionOptions;
PartitionRoot;
DispatcherTest;
struct ObserverMock { … };
struct DispatcherInitializerGuard { … };
struct BaseAllocatorDispatcherTest : public DispatcherTest { … };
template <typename A>
void DoBasicTest(A& allocator) { … }
TEST_F(BaseAllocatorDispatcherTest, VerifyInitialization) { … }
#if PA_BUILDFLAG(USE_PARTITION_ALLOC) && \
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
struct PartitionAllocator { … };
TEST_F(BaseAllocatorDispatcherTest, VerifyNotificationUsingPartitionAllocator) { … }
#endif
#if PA_BUILDFLAG(USE_ALLOCATOR_SHIM)
struct AllocatorShimAllocator { … };
#if BUILDFLAG(IS_APPLE) && !PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
#define MAYBE_VerifyNotificationUsingAllocatorShim …
#else
#define MAYBE_VerifyNotificationUsingAllocatorShim …
#endif
TEST_F(BaseAllocatorDispatcherTest, MAYBE_VerifyNotificationUsingAllocatorShim) { … }
#endif
}
}