#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "mojo/public/cpp/system/wait_set.h"
#include <set>
#include <string_view>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ptr_util.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
#include "base/threading/simple_thread.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "mojo/public/cpp/system/wait.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace {
WaitSetTest;
void WriteMessage(const ScopedMessagePipeHandle& handle,
const std::string_view& message) { … }
std::string ReadMessage(const ScopedMessagePipeHandle& handle) { … }
class ThreadedRunner : public base::SimpleThread { … };
TEST_F(WaitSetTest, Satisfied) { … }
TEST_F(WaitSetTest, Unsatisfiable) { … }
TEST_F(WaitSetTest, CloseWhileWaiting) { … }
TEST_F(WaitSetTest, CloseBeforeWaiting) { … }
TEST_F(WaitSetTest, SatisfiedThenUnsatisfied) { … }
TEST_F(WaitSetTest, EventOnly) { … }
TEST_F(WaitSetTest, EventAndHandle) { … }
TEST_F(WaitSetTest, NoStarvation) { … }
}
}