#include "mojo/public/cpp/system/simple_watcher.h"
#include <memory>
#include <string_view>
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "mojo/public/c/system/types.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace {
template <typename Handler>
void RunResultHandler(Handler f, MojoResult result) { … }
template <typename Handler>
SimpleWatcher::ReadyCallback OnReady(Handler f) { … }
SimpleWatcher::ReadyCallback NotReached() { … }
class SimpleWatcherTest : public testing::Test { … };
TEST_F(SimpleWatcherTest, WatchBasic) { … }
TEST_F(SimpleWatcherTest, WatchUnsatisfiable) { … }
TEST_F(SimpleWatcherTest, WatchFailedPreconditionNoSpam) { … }
TEST_F(SimpleWatcherTest, WatchInvalidHandle) { … }
TEST_F(SimpleWatcherTest, Cancel) { … }
TEST_F(SimpleWatcherTest, CancelOnClose) { … }
TEST_F(SimpleWatcherTest, CancelOnDestruction) { … }
TEST_F(SimpleWatcherTest, CloseAndCancel) { … }
TEST_F(SimpleWatcherTest, UnarmedCancel) { … }
TEST_F(SimpleWatcherTest, ManualArming) { … }
TEST_F(SimpleWatcherTest, ManualArmOrNotifyWhileSignaled) { … }
}
}