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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeAuraTest.cpp

Issue 1911973002: Fix scrollbar buttons at hidpi when enable-use-zoom-for-dsf is on. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "platform/scroll/ScrollbarThemeAura.h"
6
7 #include "platform/scroll/ScrollbarTestSuite.h"
8
9 namespace blink {
10
11 using testing::Return;
12
13 class ScrollbarThemeAuraTest : public ScrollbarTestSuite {
14 };
15
16 TEST_F(ScrollbarThemeAuraTest, ButtonSizeHorizontal)
17 {
18 MockScrollableArea* mockScrollableArea = MockScrollableArea::create();
19 ScrollbarThemeMock mockTheme;
20 Scrollbar* scrollbar = Scrollbar::createForTesting(
21 mockScrollableArea, HorizontalScrollbar, RegularScrollbar, &mockTheme);
22 ScrollbarThemeAura theme;
23
24 IntRect scrollbarSizeNormalDimensions(11, 22, 444, 66);
25 scrollbar->setFrameRect(scrollbarSizeNormalDimensions);
26 IntSize size1 = theme.buttonSize(*scrollbar);
27 EXPECT_EQ(66, size1.width());
28 EXPECT_EQ(66, size1.height());
29
30 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666);
31 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions);
32 IntSize size2 = theme.buttonSize(*scrollbar);
33 EXPECT_EQ(222, size2.width());
34 EXPECT_EQ(666, size2.height());
35
36 ThreadHeap::collectAllGarbage();
37 }
38
39 TEST_F(ScrollbarThemeAuraTest, ButtonSizeVertical)
40 {
41 MockScrollableArea* mockScrollableArea = MockScrollableArea::create();
42 ScrollbarThemeMock mockTheme;
43 Scrollbar* scrollbar = Scrollbar::createForTesting(
44 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme);
45 ScrollbarThemeAura theme;
46
47 IntRect scrollbarSizeNormalDimensions(11, 22, 44, 666);
48 scrollbar->setFrameRect(scrollbarSizeNormalDimensions);
49 IntSize size1 = theme.buttonSize(*scrollbar);
50 EXPECT_EQ(44, size1.width());
51 EXPECT_EQ(44, size1.height());
52
53 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666);
54 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions);
55 IntSize size2 = theme.buttonSize(*scrollbar);
56 EXPECT_EQ(444, size2.width());
57 EXPECT_EQ(333, size2.height());
58
59 ThreadHeap::collectAllGarbage();
60 }
61
62 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollbarThemeAura.cpp ('k') | ui/native_theme/native_theme.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698