#include "remoting/protocol/data_channel_manager.h"
#include <map>
#include <utility>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "remoting/base/compound_buffer.h"
#include "remoting/proto/test_data_channel_manager.pb.h"
#include "remoting/protocol/fake_message_pipe.h"
#include "remoting/protocol/fake_message_pipe_wrapper.h"
#include "remoting/protocol/named_message_pipe_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting::protocol {
namespace {
class FakeNamedMessagePipeHandler final : public NamedMessagePipeHandler { … };
void FakeNamedMessagePipeHandler::OnIncomingMessage(
std::unique_ptr<CompoundBuffer> message) { … }
FakeNamedMessagePipeHandler* FakeNamedMessagePipeHandler::Find(
const std::string& name) { … }
void FakeNamedMessagePipeHandler::Send(
const google::protobuf::MessageLite& message,
base::OnceClosure done) { … }
std::map<std::string, FakeNamedMessagePipeHandler*>
FakeNamedMessagePipeHandler::handlers_;
void TestDataChannelManagerFullMatch(bool asynchronous) { … }
void TestDataChannelManagerMultipleRegistrations(bool asynchronous) { … }
void TestDataChannelManagerPendingDataChannels(bool asynchronous) { … }
}
TEST(DataChannelManagerTest, FullMatchWithSynchronousPipe) { … }
TEST(DataChannelManagerTest, FullMatchWithAsynchronousPipe) { … }
TEST(DataChannelManagerTest, MultipleRegistrationsWithSynchronousPipe) { … }
TEST(DataChannelManagerTest, MultipleRegistrationsWithAsynchronousPipe) { … }
TEST(DataChannelManagerTest, PendingDataChannelsWithSynchronousPipe) { … }
TEST(DataChannelManagerTest, PendingDataChannelsWithAsynchronousPipe) { … }
}