#include "chrome/browser/ui/views/tabs/tab_strip_layout.h"
#include <stddef.h>
#include <string>
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/ui/tabs/tab_types.h"
#include "chrome/browser/ui/views/tabs/tab_layout_state.h"
#include "chrome/browser/ui/views/tabs/tab_width_constraints.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
namespace {
std::string TabWidthsAsString(const std::vector<gfx::Rect>& tab_bounds) { … }
std::string TabXPositionsAsString(const std::vector<gfx::Rect>& tab_bounds) { … }
struct TestCase { … };
constexpr int kStandardWidth = …;
constexpr int kTabHeight = …;
constexpr int kMinActiveWidth = …;
constexpr int kMinInactiveWidth = …;
constexpr int kPinnedWidth = …;
constexpr int kTabOverlap = …;
std::vector<gfx::Rect> CalculateTabBounds(TestCase test_case) { … }
}
TEST(TabStripLayoutTest, Basics) { … }
TEST(TabStripLayoutTest, AllPinnedTabs) { … }
TEST(TabStripLayoutTest, MixedPinnedAndNormalTabs) { … }
TEST(TabStripLayoutTest, MiddleWidth) { … }
TEST(TabStripLayoutTest, MiddleWidthAndPinnedTab) { … }
TEST(TabStripLayoutTest, MiddleWidthRounded) { … }
TEST(TabStripLayoutTest, MiddleWidthRoundedAndPinnedTab) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidthOneTab) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidth) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidthRounded) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidthActivePinnedTab) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidthInactivePinnedTab) { … }
TEST(TabStripLayoutTest, BelowMinActiveWidthActivePinnedTabRounded) { … }
TEST(TabStripLayoutTest, NotEnoughSpace) { … }
TEST(TabStripLayoutTest, NotEnoughSpaceAllPinnedTabs) { … }
TEST(TabStripLayoutTest, NotEnoughSpaceMixedPinnedAndNormalTabs) { … }
TEST(TabStripLayoutTest, ExactlyEnoughSpaceAllPinnedTabs) { … }