#include "util/linux/memory_map.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include "base/files/file_path.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "partition_alloc/buildflags.h"
#include "test/errors.h"
#include "test/file.h"
#include "test/linux/fake_ptrace_connection.h"
#include "test/multiprocess.h"
#include "test/scoped_temp_dir.h"
#include "third_party/lss/lss.h"
#include "util/file/file_io.h"
#include "util/file/scoped_remove_file.h"
#include "util/linux/direct_ptrace_connection.h"
#include "util/misc/clock.h"
#include "util/misc/from_pointer_cast.h"
#include "util/posix/scoped_mmap.h"
namespace crashpad {
namespace test {
namespace {
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
#define MAYBE_SelfLargeFiles …
#else
#define MAYBE_SelfLargeFiles …
#endif
TEST(MemoryMap, MAYBE_SelfLargeFiles) { … }
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
#define MAYBE_SelfBasic …
#else
#define MAYBE_SelfBasic …
#endif
TEST(MemoryMap, MAYBE_SelfBasic) { … }
void InitializeFile(const base::FilePath& path,
size_t size,
ScopedFileHandle* handle) { … }
class MapChildTest : public Multiprocess { … };
TEST(MemoryMap, MapChild) { … }
void InitializeMappings(ScopedMmap* mappings,
size_t num_mappings,
size_t mapping_size) { … }
void ExpectMappings(const MemoryMap& map,
LinuxVMAddress region_addr,
size_t num_mappings,
size_t mapping_size) { … }
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
#define MAYBE_SelfLargeMapFile …
#else
#define MAYBE_SelfLargeMapFile …
#endif
TEST(MemoryMap, MAYBE_SelfLargeMapFile) { … }
class MapRunningChildTest : public Multiprocess { … };
TEST(MemoryMap, MapRunningChild) { … }
void ExpectFindFilePossibleMmapStarts(LinuxVMAddress mapping_start,
LinuxVMSize page_size) { … }
TEST(MemoryMap, FindFilePossibleMmapStarts) { … }
TEST(MemoryMap, FindFilePossibleMmapStarts_MultipleStarts) { … }
}
}
}