chromium/third_party/openscreen/src/cast/streaming/impl/capture_recommendations_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/capture_recommendations.h"

#include <optional>

#include "cast/streaming/public/answer_messages.h"
#include "cast/streaming/resolution.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "util/chrono_helpers.h"

namespace openscreen::cast {
namespace capture_recommendations {
namespace {

const Recommendations kDefaultRecommendations{};

const DisplayDescription kEmptyDescription{};

const DisplayDescription kValidOnlyResolution{};

const DisplayDescription kValidOnlyAspectRatio{};

const DisplayDescription kValidOnlyAspectRatioSixteenNine{};

const DisplayDescription kValidOnlyVariable{};

const DisplayDescription kInvalidOnlyFixed{};

const DisplayDescription kValidFixedAspectRatio{};

const DisplayDescription kValidVariableAspectRatio{};

const DisplayDescription kValidFixedMissingAspectRatio{};

const DisplayDescription kValidDisplayFhd{};

const DisplayDescription kValidDisplayXga{};

const DisplayDescription kValidDisplayTiny{};

const DisplayDescription kValidDisplayMismatched{};

const Constraints kEmptyConstraints{};

const Constraints kValidConstraintsHighEnd{};

const Constraints kValidConstraintsLowEnd{};

}  // namespace

TEST(CaptureRecommendationsTest, UsesDefaultsIfNoReceiverInformationAvailable) {}

TEST(CaptureRecommendationsTest, EmptyDisplayDescription) {}

TEST(CaptureRecommendationsTest, OnlyResolution) {}

TEST(CaptureRecommendationsTest, OnlyAspectRatioFourThirds) {}

TEST(CaptureRecommendationsTest, OnlyAspectRatioSixteenNine) {}

TEST(CaptureRecommendationsTest, OnlyAspectRatioConstraint) {}

// It doesn't make sense to just provide a "fixed" aspect ratio with no
// other dimension information, so we just return default recommendations
// in this case and assume the sender will handle it elsewhere, e.g. on
// ANSWER message parsing.
TEST(CaptureRecommendationsTest, OnlyInvalidAspectRatioConstraint) {}

TEST(CaptureRecommendationsTest, FixedAspectRatioConstraint) {}

// Our behavior is actually the same whether the constraint is passed, we
// just percolate the constraint up to the capture devices so that intermediate
// frame sizes between minimum and maximum can be properly scaled.
TEST(CaptureRecommendationsTest, VariableAspectRatioConstraint) {}

TEST(CaptureRecommendationsTest, ResolutionWithFixedConstraint) {}

TEST(CaptureRecommendationsTest, ExplicitFhdChangesMinimum) {}

TEST(CaptureRecommendationsTest, XgaResolution) {}

TEST(CaptureRecommendationsTest, MismatchedDisplayAndAspectRatio) {}

TEST(CaptureRecommendationsTest, TinyDisplay) {}

TEST(CaptureRecommendationsTest, EmptyConstraints) {}

// Generally speaking, if the receiver gives us constraints higher than our
// defaults we will accept them, with the exception of maximum resolutions
// exceeding 1080P.
TEST(CaptureRecommendationsTest, HandlesHighEnd) {}

// However, if the receiver gives us constraints lower than our minimum
// defaults, we will ignore them--they would result in an unacceptable cast
// experience.
TEST(CaptureRecommendationsTest, HandlesLowEnd) {}

TEST(CaptureRecommendationsTest, HandlesTooSmallScreen) {}

TEST(CaptureRecommendationsTest, HandlesMinimumSizeScreen) {}

TEST(CaptureRecommendationsTest, UsesIntersectionOfDisplayAndConstraints) {}

}  // namespace capture_recommendations
}  // namespace openscreen::cast