#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <cmath>
#include <string>
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/files/platform_file.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/json/json_reader.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "chrome/test/chromedriver/net/pipe_writer_posix.h"
#include "chrome/test/chromedriver/net/timeout.h"
#include "net/base/completion_once_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace {
std::pair<std::string, int> ReadAll(base::File read_pipe) { … }
int WriteAll(std::unique_ptr<PipeWriterPosix> writer, std::string message) { … }
}
class PipeWriterPosixTest : public testing::Test { … };
TEST_F(PipeWriterPosixTest, Ctor) { … }
TEST_F(PipeWriterPosixTest, CreateAndBind) { … }
TEST_F(PipeWriterPosixTest, Close) { … }
TEST_F(PipeWriterPosixTest, Write) { … }
TEST_F(PipeWriterPosixTest, WriteToClosed) { … }
TEST_F(PipeWriterPosixTest, WriteLarge) { … }