blob: c7144552605c61620fe15e6e0b69187de68247da [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/layout/MinMaxSize.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
namespace {
TEST(NGUnitsTest, ShrinkToFit) {
MinMaxSize sizes;
sizes.min_size = LayoutUnit(100);
sizes.max_size = LayoutUnit(200);
EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(300)));
sizes.min_size = LayoutUnit(100);
sizes.max_size = LayoutUnit(300);
EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(200)));
sizes.min_size = LayoutUnit(200);
sizes.max_size = LayoutUnit(300);
EXPECT_EQ(LayoutUnit(200), sizes.ShrinkToFit(LayoutUnit(100)));
}
} // namespace
} // namespace blink