#include "mojo/core/ipcz_driver/shared_buffer.h"
#include <string.h>
#include <string>
#include <utility>
#include "base/memory/platform_shared_memory_region.h"
#include "base/notreached.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#include "mojo/core/embedder/embedder.h"
#include "mojo/core/test/mojo_test_base.h"
#include "mojo/public/c/system/types.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(MOJO_SUPPORT_LEGACY_CORE)
#include "mojo/core/core.h"
#include "mojo/core/shared_buffer_dispatcher.h"
#endif
namespace mojo::core {
namespace {
SharedBufferTest;
TEST_F(SharedBufferTest, CreateSharedBuffer) { … }
TEST_F(SharedBufferTest, DuplicateSharedBuffer) { … }
TEST_F(SharedBufferTest, PassSharedBufferLocal) { … }
#if BUILDFLAG(USE_BLINK)
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(CopyToBufferClient, SharedBufferTest, h) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_PassSharedBufferCrossProcess …
#else
#define MAYBE_PassSharedBufferCrossProcess …
#endif
TEST_F(SharedBufferTest, MAYBE_PassSharedBufferCrossProcess) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(CreateBufferClient, SharedBufferTest, h) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_PassSharedBufferFromChild …
#else
#define MAYBE_PassSharedBufferFromChild …
#endif
TEST_F(SharedBufferTest, MAYBE_PassSharedBufferFromChild) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(CreateAndPassBuffer, SharedBufferTest, h) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(ReceiveAndEditBuffer, SharedBufferTest, h) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_PassSharedBufferFromChildToChild …
#else
#define MAYBE_PassSharedBufferFromChildToChild …
#endif
TEST_F(SharedBufferTest, MAYBE_PassSharedBufferFromChildToChild) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(CreateAndPassBufferParent,
SharedBufferTest,
parent) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(ReceiveAndEditBufferParent,
SharedBufferTest,
parent) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_PassHandleBetweenCousins …
#else
#define MAYBE_PassHandleBetweenCousins …
#endif
TEST_F(SharedBufferTest, MAYBE_PassHandleBetweenCousins) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(ReadAndMapWriteSharedBuffer,
SharedBufferTest,
h) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_CreateAndPassReadOnlyBuffer …
#else
#define MAYBE_CreateAndPassReadOnlyBuffer …
#endif
TEST_F(SharedBufferTest, MAYBE_CreateAndPassReadOnlyBuffer) { … }
DEFINE_TEST_CLIENT_TEST_WITH_PIPE(CreateAndPassReadOnlyBuffer,
SharedBufferTest,
h) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_CreateAndPassFromChildReadOnlyBuffer …
#else
#define MAYBE_CreateAndPassFromChildReadOnlyBuffer …
#endif
TEST_F(SharedBufferTest, MAYBE_CreateAndPassFromChildReadOnlyBuffer) { … }
#endif
}
}