chromium/third_party/openscreen/src/cast/streaming/impl/session_messenger_unittest.cc

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

#include "cast/streaming/public/session_messenger.h"

#include <memory>

#include "cast/streaming/testing/message_pipe.h"
#include "cast/streaming/testing/simple_message_port.h"
#include "gtest/gtest.h"
#include "platform/test/fake_clock.h"
#include "platform/test/fake_task_runner.h"

namespace openscreen::cast {

ElementsAre;

namespace {

constexpr char kSenderId[] =;
constexpr char kReceiverId[] =;

// Generally the messages are inlined below, with the exception of the Offer,
// simply because it is massive.
Offer kExampleOffer{};

struct SessionMessageStore {};
}  // namespace

class SessionMessengerTest : public ::testing::Test {};

TEST_F(SessionMessengerTest, RpcMessaging) {}

TEST_F(SessionMessengerTest, CapabilitiesMessaging) {}

TEST_F(SessionMessengerTest, OfferAnswerMessaging) {}

TEST_F(SessionMessengerTest, OfferAndReceiverError) {}

TEST_F(SessionMessengerTest, UnknownSenderMessageTypesDontGetSent) {}

TEST_F(SessionMessengerTest, UnknownReceiverMessageTypesDontGetSent) {}

TEST_F(SessionMessengerTest, ReceiverHandlesUnknownMessageType) {}

TEST_F(SessionMessengerTest, SenderHandlesUnknownMessageType) {}

TEST_F(SessionMessengerTest, SenderHandlesMessageMissingSequenceNumber) {}

TEST_F(SessionMessengerTest, ReceiverCannotSendToEmptyId) {}

TEST_F(SessionMessengerTest, ErrorMessageLoggedIfTimeout) {}

// Make sure that we don't SEGFAULT if we cause the messenger to get deleted or
// its replies cleared as part of executing an error callback on timeout.
// See issuetracker.google.com/250957657 for more context.
TEST_F(SessionMessengerTest, SenderHandlesTimeoutThatCausesDelete) {}

TEST_F(SessionMessengerTest, SenderHandlesMessageThatCausesDelete) {}

TEST_F(SessionMessengerTest, RecieverHandlesMessageThatCausesDelete) {}

TEST_F(SessionMessengerTest, ReceiverHandlesMessagesFromMultipleSenders) {}

TEST_F(SessionMessengerTest, SenderRejectsMessageFromWrongReceiver) {}

TEST_F(SessionMessengerTest, ReceiverRejectsMessagesWithoutHandler) {}

TEST_F(SessionMessengerTest, SenderRejectsMessagesWithoutHandler) {}

TEST_F(SessionMessengerTest, UnknownNamespaceMessagesGetDropped) {}

}  // namespace openscreen::cast