chromium/remoting/protocol/message_reader_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <string>

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/task_environment.h"
#include "net/base/net_errors.h"
#include "net/socket/socket.h"
#include "remoting/protocol/fake_stream_socket.h"
#include "remoting/protocol/message_reader.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/webrtc/rtc_base/byte_order.h"

_;
DoAll;
Mock;
SaveArg;

namespace remoting::protocol {

namespace {
const char kTestMessage1[] =;
const char kTestMessage2[] =;
}  // namespace

class MockMessageReceivedCallback {};

class MessageReaderTest : public testing::Test {};

// Receive one message.
TEST_F(MessageReaderTest, OneMessage) {}

// Receive two messages in one packet.
TEST_F(MessageReaderTest, TwoMessages_Together) {}

// Receive two messages in separate packets.
TEST_F(MessageReaderTest, TwoMessages_Separately) {}

// Read() returns error.
TEST_F(MessageReaderTest, ReadError) {}

// Read() returns 0 (end of stream).
TEST_F(MessageReaderTest, EndOfStream) {}

// Verify that we the OnMessage callback is not reentered.
TEST_F(MessageReaderTest, ReadFromCallback) {}

// Verify that we stop getting callbacks after deleting MessageReader.
TEST_F(MessageReaderTest, DeleteFromCallback) {}

}  // namespace remoting::protocol