#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "mojo/core/core_ipcz.h"
#include <cstring>
#include <string_view>
#include "base/check.h"
#include "base/containers/span.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/waitable_event.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#include "mojo/core/embedder/embedder.h"
#include "mojo/core/ipcz_api.h"
#include "mojo/core/ipcz_driver/transport.h"
#include "mojo/core/test/mojo_test_base.h"
#include "mojo/public/c/system/invitation.h"
#include "mojo/public/c/system/thunks.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo::core {
namespace {
struct InvitationDetails { … };
class CoreIpczTest : public test::MojoTestBase { … };
class ChannelPeerClosureListener { … };
class CoreIpczTestClient : public CoreIpczTest { … };
TEST_F(CoreIpczTest, Close) { … }
TEST_F(CoreIpczTest, BasicMessageUsage) { … }
TEST_F(CoreIpczTest, MessageDestruction) { … }
TEST_F(CoreIpczTest, MessagePipes) { … }
TEST_F(CoreIpczTest, Traps) { … }
TEST_F(CoreIpczTest, WrapPlatformHandle) { … }
TEST_F(CoreIpczTest, BasicSharedBuffer) { … }
TEST_F(CoreIpczTest, SharedBufferDuplicateUnsafe) { … }
TEST_F(CoreIpczTest, DataPipeReadWriteQeury) { … }
TEST_F(CoreIpczTest, DataPipeTwoPhase) { … }
#if BUILDFLAG(USE_BLINK)
constexpr std::string_view kAttachmentName = …;
constexpr std::string_view kTestMessages[] = …;
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(InvitationSingleAttachmentClient,
CoreIpczTestClient,
h) { … }
TEST_F(CoreIpczTest, InvitationSingleAttachment) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(InvitationMultipleAttachmentsClient,
CoreIpczTestClient,
h) { … }
TEST_F(CoreIpczTest, InvitationMultipleAttachments) { … }
constexpr std::string_view kDataPipeMessage = …;
constexpr size_t kDataPipeCapacity = …;
static_assert …;
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(DataPipeTransferClient,
CoreIpczTestClient,
h) { … }
TEST_F(CoreIpczTest, DataPipeTransfer) { … }
#endif
}
}