#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/capture/content/capture_resolution_chooser.h"
#include <stddef.h>
#include <numeric>
#include "base/location.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/size.h"
Location;
namespace media {
namespace {
constexpr int kMaxFrameWidth = …;
constexpr int kMaxFrameHeight = …;
constexpr int kMinFrameWidth = …;
constexpr int kMinFrameHeight = …;
constexpr int kSmallestNonEmptyWidth = …;
constexpr int kSmallestNonEmptyHeight = …;
void ExpectIsWithinBoundsAndSameAspectRatio(const Location& location,
const gfx::Size& min_size,
const gfx::Size& max_size,
const gfx::Size& size) { … }
void TestSnappedFrameSizes(CaptureResolutionChooser* chooser,
const gfx::Size& smallest_size) { … }
void TestTargetedFrameAreas(CaptureResolutionChooser* chooser,
const gfx::Size& smallest_size) { … }
void ExpectOnlyOneSnappedFrameSize(const CaptureResolutionChooser& chooser,
const gfx::Size& the_one_size) { … }
}
TEST(CaptureResolutionChooserTest, DefaultCaptureSizeIfNeverSetConstraints) { … }
TEST(CaptureResolutionChooserTest, ReasonableCaptureSizeWhenMissingSourceSize) { … }
TEST(CaptureResolutionChooserTest,
FixedResolutionPolicy_CaptureSizeAlwaysFixed) { … }
TEST(CaptureResolutionChooserTest,
FixedAspectRatioPolicy_CaptureSizeHasSameAspectRatio) { … }
TEST(CaptureResolutionChooserTest,
AnyWithinLimitPolicy_CaptureSizeIsAnythingWithinLimits) { … }
}