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

// Copyright 2019 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/impl/compound_rtcp_parser.h"

#include <chrono>
#include <cmath>

#include "cast/streaming/impl/rtcp_session.h"
#include "cast/streaming/testing/mock_compound_rtcp_parser_client.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "platform/api/time.h"
#include "platform/base/trivial_clock_traits.h"
#include "util/chrono_helpers.h"

_;
Invoke;
Mock;
SaveArg;
StrictMock;

namespace openscreen::cast {
namespace {

constexpr Ssrc kSenderSsrc{};
constexpr Ssrc kReceiverSsrc{};

}  // namespace

class CompoundRtcpParserTest : public testing::Test {};

TEST_F(CompoundRtcpParserTest, ProcessesEmptyPacket) {}

TEST_F(CompoundRtcpParserTest, ReturnsErrorForGarbage) {}

TEST_F(CompoundRtcpParserTest, ParsesReceiverReportWithoutReportBlock) {}

TEST_F(CompoundRtcpParserTest, ParsesReceiverReportWithReportBlock) {}

TEST_F(CompoundRtcpParserTest, ParsesPictureLossIndicatorMessage) {}

TEST_F(CompoundRtcpParserTest, OnCastReceiverFrameLogMessages_ValidPacket) {}

TEST_F(CompoundRtcpParserTest,
       OnCastReceiverFrameLogMessages_MultiplePopulatedPackets) {}

TEST_F(CompoundRtcpParserTest, OnCastReceiverFrameLogMessages_WrongName) {}

TEST_F(CompoundRtcpParserTest, OnCastReceiverFrameLogMessages_InvalidSsrc) {}

TEST_F(CompoundRtcpParserTest,
       OnCastReceiverFrameLogMessages_InvalidPacketSize) {}

// Tests that RTCP packets containing chronologically-old data are ignored. This
// test's methodology simulates a real-world possibility: A receiver sends a
// "Picture Loss Indicator" in one RTCP packet, and then it sends another packet
// ~1 second later without the PLI, indicating the problem has been resolved.
// However, the packets are delivered out-of-order by the network. In this case,
// the CompoundRtcpParser should ignore the stale packet containing the PLI.
TEST_F(CompoundRtcpParserTest, IgnoresStalePackets) {}

// Tests that unknown RTCP extended reports are ignored, but known ones are
// still parsed when sent alongside the unknown ones.
TEST_F(CompoundRtcpParserTest, IgnoresUnknownExtendedReports) {}

// Tests that a simple Cast Feedback packet is parsed, and the checkpoint frame
// ID is properly bit-extended, based on the current state of the Sender.
TEST_F(CompoundRtcpParserTest, ParsesSimpleFeedback) {}

// Tests NACK feedback parsing, and that redundant NACKs are de-duped, and that
// the results are delivered to the client sorted.
TEST_F(CompoundRtcpParserTest, ParsesFeedbackWithNacks) {}

// Tests the CST2 "later frame ACK" parsing: Both the common "2 bytes of bit
// vector" case, and a "multiple words of bit vector" case.
TEST_F(CompoundRtcpParserTest, ParsesFeedbackWithAcks) {}

}  // namespace openscreen::cast