#include "ipc/ipc_message_attachment_set.h"
#include <fcntl.h>
#include <stddef.h>
#include <unistd.h>
#include "base/posix/eintr_wrapper.h"
#include "build/build_config.h"
#include "ipc/ipc_platform_file_attachment_posix.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_FUCHSIA)
#include <lib/fdio/fdio.h>
#endif
namespace IPC {
namespace {
int GetSafeFd() { … }
bool VerifyClosed(int fd) { … }
int GetFdAt(MessageAttachmentSet* set, int id) { … }
static const int kFDBase = …;
TEST(MessageAttachmentSet, BasicAdd) { … }
TEST(MessageAttachmentSet, BasicAddAndClose) { … }
TEST(MessageAttachmentSet, MaxSize) { … }
TEST(MessageAttachmentSet, WalkInOrder) { … }
TEST(MessageAttachmentSet, WalkWrongOrder) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_DontClose …
#else
#define MAYBE_DontClose …
#endif
TEST(MessageAttachmentSet, MAYBE_DontClose) { … }
TEST(MessageAttachmentSet, DoClose) { … }
}
}