#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/host/security_key/security_key_message_writer_impl.h"
#include <cstdint>
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "remoting/host/security_key/security_key_message.h"
#include "remoting/host/setup/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
const remoting::SecurityKeyMessageType kTestMessageType = …;
const unsigned int kLargeMessageSizeBytes = …;
}
namespace remoting {
class SecurityKeyMessageWriterImplTest : public testing::Test { … };
SecurityKeyMessageWriterImplTest::SecurityKeyMessageWriterImplTest() = default;
SecurityKeyMessageWriterImplTest::~SecurityKeyMessageWriterImplTest() = default;
std::string SecurityKeyMessageWriterImplTest::ReadMessage(
int payload_length_bytes) { … }
void SecurityKeyMessageWriterImplTest::OnReadComplete(
base::OnceClosure done_callback,
const std::string& result) { … }
void SecurityKeyMessageWriterImplTest::SetUp() { … }
void SecurityKeyMessageWriterImplTest::WriteMessageToOutput(
const std::string& payload) { … }
TEST_F(SecurityKeyMessageWriterImplTest, WriteMessageWithoutPayload) { … }
TEST_F(SecurityKeyMessageWriterImplTest, WriteMessageWithPayload) { … }
TEST_F(SecurityKeyMessageWriterImplTest, WriteMessageWithLargePayload) { … }
TEST_F(SecurityKeyMessageWriterImplTest, WriteMultipleMessages) { … }
TEST_F(SecurityKeyMessageWriterImplTest, EnsureWriteFailsWhenPipeClosed) { … }
}