| Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp
|
| diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp
|
| index 110ca2f089883c4dea2818522ca7350d0aa72097..a80b75a2f8851022c220dc9d26ddd1df27b9bd0b 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp
|
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp
|
| @@ -10,6 +10,31 @@ namespace blink {
|
|
|
| using testing::Return;
|
|
|
| +namespace {
|
| +
|
| +class ScrollbarThemeAuraButtonOverride final : public ScrollbarThemeAura {
|
| +public:
|
| + ScrollbarThemeAuraButtonOverride()
|
| + : m_hasScrollbarButtons(true)
|
| + {
|
| + }
|
| +
|
| + void setHasScrollbarButtons(bool value)
|
| + {
|
| + m_hasScrollbarButtons = value;
|
| + }
|
| +
|
| + bool hasScrollbarButtons(ScrollbarOrientation unused) const override
|
| + {
|
| + return m_hasScrollbarButtons;
|
| + }
|
| +
|
| +private:
|
| + bool m_hasScrollbarButtons;
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| class ScrollbarThemeAuraTest : public ScrollbarTestSuite {
|
| };
|
|
|
| @@ -19,7 +44,7 @@ TEST_F(ScrollbarThemeAuraTest, ButtonSizeHorizontal)
|
| ScrollbarThemeMock mockTheme;
|
| Scrollbar* scrollbar = Scrollbar::createForTesting(
|
| mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &mockTheme);
|
| - ScrollbarThemeAura theme;
|
| + ScrollbarThemeAuraButtonOverride theme;
|
|
|
| IntRect scrollbarSizeNormalDimensions(11, 22, 444, 66);
|
| scrollbar->setFrameRect(scrollbarSizeNormalDimensions);
|
| @@ -42,7 +67,7 @@ TEST_F(ScrollbarThemeAuraTest, ButtonSizeVertical)
|
| ScrollbarThemeMock mockTheme;
|
| Scrollbar* scrollbar = Scrollbar::createForTesting(
|
| mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme);
|
| - ScrollbarThemeAura theme;
|
| + ScrollbarThemeAuraButtonOverride theme;
|
|
|
| IntRect scrollbarSizeNormalDimensions(11, 22, 44, 666);
|
| scrollbar->setFrameRect(scrollbarSizeNormalDimensions);
|
| @@ -59,4 +84,21 @@ TEST_F(ScrollbarThemeAuraTest, ButtonSizeVertical)
|
| ThreadHeap::collectAllGarbage();
|
| }
|
|
|
| +TEST_F(ScrollbarThemeAuraTest, NoButtonsReturnsSize0)
|
| +{
|
| + MockScrollableArea* mockScrollableArea = MockScrollableArea::create();
|
| + ScrollbarThemeMock mockTheme;
|
| + Scrollbar* scrollbar = Scrollbar::createForTesting(
|
| + mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme);
|
| + ScrollbarThemeAuraButtonOverride theme;
|
| + theme.setHasScrollbarButtons(false);
|
| +
|
| + scrollbar->setFrameRect(IntRect(1, 2, 3, 4));
|
| + IntSize size = theme.buttonSize(*scrollbar);
|
| + EXPECT_EQ(0, size.width());
|
| + EXPECT_EQ(0, size.height());
|
| +
|
| + ThreadHeap::collectAllGarbage();
|
| +}
|
| +
|
| } // namespace blink
|
|
|