#include "snapshot/sanitized/process_snapshot_sanitized.h"
#include <string.h>
#include <iterator>
#include "base/notreached.h"
#include "build/build_config.h"
#include "gtest/gtest.h"
#include "test/multiprocess_exec.h"
#include "util/file/file_io.h"
#include "util/misc/address_sanitizer.h"
#include "util/numeric/safe_assignment.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
#include <sys/syscall.h>
#include "snapshot/linux/process_snapshot_linux.h"
#include "util/linux/direct_ptrace_connection.h"
#include "util/linux/exception_information.h"
#include "util/posix/signals.h"
#endif
namespace crashpad {
namespace test {
namespace {
class ExceptionGenerator { … };
constexpr char kAllowedAnnotationName[] = …;
constexpr char kAllowedAnnotationNamePattern[] = …;
constexpr char kAllowedAnnotationNamePatternActual[] = …;
constexpr char kAllowedAnnotationValue[] = …;
constexpr char kNonAllowedAnnotationName[] = …;
constexpr char kNonAllowedAnnotationValue[] = …;
constexpr char kSensitiveStackData[] = …;
struct ChildTestAddresses { … };
void ChildTestFunction() { … }
CRASHPAD_CHILD_TEST_MAIN(ChildToBeSanitized) { … }
void ExpectAnnotations(ProcessSnapshot* snapshot, bool sanitized) { … }
void ExpectProcessMemory(ProcessSnapshot* snapshot,
VMAddress allowed_byte,
bool sanitized) { … }
class StackSanitizationChecker : public MemorySnapshot::Delegate { … };
void ExpectStackData(ProcessSnapshot* snapshot,
const ChildTestAddresses& addrs,
bool sanitized) { … }
class SanitizeTest : public MultiprocessExec { … };
TEST(ProcessSnapshotSanitized, Sanitize) { … }
}
}
}