Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp

Issue 2006643004: Fix scrollbar buttons on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove function in themeEngine Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollbarThemeAura.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollbarThemeAura.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698