#include "cast/streaming/public/sender_session.h"
#include <cstdio>
#include <utility>
#include "cast/streaming/capture_configs.h"
#include "cast/streaming/public/capture_recommendations.h"
#include "cast/streaming/testing/mock_environment.h"
#include "cast/streaming/testing/simple_message_port.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "platform/base/ip_address.h"
#include "platform/test/fake_clock.h"
#include "platform/test/fake_task_runner.h"
#include "util/chrono_helpers.h"
#include "util/stringprintf.h"
_;
InSequence;
Invoke;
NiceMock;
Return;
StrictMock;
namespace openscreen::cast {
namespace {
constexpr char kMalformedAnswerMessage[] = …;
constexpr char kValidJsonInvalidFormatAnswerMessage[] = …;
constexpr char kValidJsonInvalidAnswerMessage[] = …;
constexpr char kMissingAnswerMessage[] = …;
constexpr char kInvalidSequenceNumberMessage[] = …;
constexpr char kUnknownTypeMessage[] = …;
constexpr char kInvalidTypeMessage[] = …;
constexpr char kInvalidTypeMessageWithNoSeqNum[] = …;
constexpr char kErrorAnswerMessage[] = …;
constexpr char kCapabilitiesResponse[] = …;
constexpr char kCapabilitiesErrorResponse[] = …;
const AudioCaptureConfig kAudioCaptureConfigInvalidChannels{ … };
const AudioCaptureConfig kAudioCaptureConfigValid{ … };
const VideoCaptureConfig kVideoCaptureConfigMissingResolutions{ … };
const VideoCaptureConfig kVideoCaptureConfigInvalid{ … };
const VideoCaptureConfig kVideoCaptureConfigValid{ … };
const VideoCaptureConfig kVideoCaptureConfigValidSimplest{ … };
class FakeClient : public SenderSession::Client { … };
MATCHER_P(CodeEquals, code, "Checks error codes but not messages.") { … }
}
class SenderSessionTest : public ::testing::Test { … };
TEST_F(SenderSessionTest, ComplainsIfNoConfigsToOffer) { … }
TEST_F(SenderSessionTest, ComplainsIfInvalidAudioCaptureConfig) { … }
TEST_F(SenderSessionTest, ComplainsIfInvalidVideoCaptureConfig) { … }
TEST_F(SenderSessionTest, ComplainsIfMissingResolutions) { … }
TEST_F(SenderSessionTest, SendsOfferWithZeroBitrateOptions) { … }
TEST_F(SenderSessionTest, SendsOfferWithSimpleVideoOnly) { … }
TEST_F(SenderSessionTest, SendsOfferAudioOnly) { … }
TEST_F(SenderSessionTest, SendsOfferMessage) { … }
TEST_F(SenderSessionTest, HandlesValidAnswer) { … }
TEST_F(SenderSessionTest, HandlesStreamTypes) { … }
TEST_F(SenderSessionTest, HandlesInvalidNamespace) { … }
TEST_F(SenderSessionTest, HandlesMalformedAnswer) { … }
TEST_F(SenderSessionTest, HandlesImproperlyFormattedAnswer) { … }
TEST_F(SenderSessionTest, HandlesInvalidAnswer) { … }
TEST_F(SenderSessionTest, HandlesNullAnswer) { … }
TEST_F(SenderSessionTest, HandlesAnswerTimeout) { … }
TEST_F(SenderSessionTest, HandlesCapabilitiesTimeout) { … }
TEST_F(SenderSessionTest, HandlesInvalidSequenceNumber) { … }
TEST_F(SenderSessionTest, HandlesUnknownTypeMessageWithValidSeqNum) { … }
TEST_F(SenderSessionTest, HandlesInvalidTypeMessageWithValidSeqNum) { … }
TEST_F(SenderSessionTest, HandlesInvalidTypeMessage) { … }
TEST_F(SenderSessionTest, HandlesErrorMessage) { … }
TEST_F(SenderSessionTest, HandlesMessagePortError) { … }
TEST_F(SenderSessionTest, ReportsZeroBandwidthWhenNoPacketsSent) { … }
TEST_F(SenderSessionTest, ComplainsIfInvalidAudioCaptureConfigRemoting) { … }
TEST_F(SenderSessionTest, ComplainsIfInvalidVideoCaptureConfigRemoting) { … }
TEST_F(SenderSessionTest, ComplainsIfMissingResolutionsRemoting) { … }
TEST_F(SenderSessionTest, HandlesValidAnswerRemoting) { … }
TEST_F(SenderSessionTest, SuccessfulRemotingNegotiationYieldsValidObject) { … }
TEST_F(SenderSessionTest, SuccessfulGetCapabilitiesRequest) { … }
}