chromium/components/viz/common/frame_sinks/copy_output_util_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/viz/common/frame_sinks/copy_output_util.h"

#include <limits>

#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/vector2d.h"

namespace viz {
namespace copy_output {

namespace {

// Some very large integers that should be big enough to trigger overflow
// conditions, if the implementation is doing bad math.
constexpr int kMaxInt =;
constexpr int kMaxEvenInt =;

// These are all equivalent to a scale ratio of 1:1.
constexpr gfx::Vector2d kNonScalingVectors[5][2] =;

// These are all equivalent to a scale ratio of 1:2 in the X direction.
constexpr gfx::Vector2d kDoublingXVectors[4][2] =;

// These are all equivalent to a scale ratio of 1:2 in the Y direction.
constexpr gfx::Vector2d kDoublingYVectors[4][2] =;

// These are all equivalent to a scale ratio of 2:1 in the X direction.
constexpr gfx::Vector2d kHalvingXVectors[4][2] =;

// These are all equivalent to a scale ratio of 2:1 in the Y direction.
constexpr gfx::Vector2d kHalvingYVectors[4][2] =;

TEST(CopyOutputUtil, ComputesValidResultRects) {}

TEST(CopyOutputUtil, IdentifiesUnreasonableResultRects) {}

}  // namespace

}  // namespace copy_output
}  // namespace viz