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

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

Issue 2321223003: Revert of Move collectGarbage* methods to ThreadState (Closed)
Patch Set: Created 4 years, 3 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/scroll/ScrollbarThemeAura.h" 5 #include "platform/scroll/ScrollbarThemeAura.h"
6 6
7 #include "platform/scroll/ScrollbarTestSuite.h" 7 #include "platform/scroll/ScrollbarTestSuite.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 IntSize size1 = theme.buttonSize(*scrollbar); 51 IntSize size1 = theme.buttonSize(*scrollbar);
52 EXPECT_EQ(66, size1.width()); 52 EXPECT_EQ(66, size1.width());
53 EXPECT_EQ(66, size1.height()); 53 EXPECT_EQ(66, size1.height());
54 54
55 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666); 55 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666);
56 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions); 56 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions);
57 IntSize size2 = theme.buttonSize(*scrollbar); 57 IntSize size2 = theme.buttonSize(*scrollbar);
58 EXPECT_EQ(222, size2.width()); 58 EXPECT_EQ(222, size2.width());
59 EXPECT_EQ(666, size2.height()); 59 EXPECT_EQ(666, size2.height());
60 60
61 ThreadState::current()-> collectAllGarbage(); 61 ThreadHeap::collectAllGarbage();
62 } 62 }
63 63
64 TEST_F(ScrollbarThemeAuraTest, ButtonSizeVertical) 64 TEST_F(ScrollbarThemeAuraTest, ButtonSizeVertical)
65 { 65 {
66 MockScrollableArea* mockScrollableArea = MockScrollableArea::create(); 66 MockScrollableArea* mockScrollableArea = MockScrollableArea::create();
67 ScrollbarThemeMock mockTheme; 67 ScrollbarThemeMock mockTheme;
68 Scrollbar* scrollbar = Scrollbar::createForTesting( 68 Scrollbar* scrollbar = Scrollbar::createForTesting(
69 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme); 69 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme);
70 ScrollbarThemeAuraButtonOverride theme; 70 ScrollbarThemeAuraButtonOverride theme;
71 71
72 IntRect scrollbarSizeNormalDimensions(11, 22, 44, 666); 72 IntRect scrollbarSizeNormalDimensions(11, 22, 44, 666);
73 scrollbar->setFrameRect(scrollbarSizeNormalDimensions); 73 scrollbar->setFrameRect(scrollbarSizeNormalDimensions);
74 IntSize size1 = theme.buttonSize(*scrollbar); 74 IntSize size1 = theme.buttonSize(*scrollbar);
75 EXPECT_EQ(44, size1.width()); 75 EXPECT_EQ(44, size1.width());
76 EXPECT_EQ(44, size1.height()); 76 EXPECT_EQ(44, size1.height());
77 77
78 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666); 78 IntRect scrollbarSizeSquashedDimensions(11, 22, 444, 666);
79 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions); 79 scrollbar->setFrameRect(scrollbarSizeSquashedDimensions);
80 IntSize size2 = theme.buttonSize(*scrollbar); 80 IntSize size2 = theme.buttonSize(*scrollbar);
81 EXPECT_EQ(444, size2.width()); 81 EXPECT_EQ(444, size2.width());
82 EXPECT_EQ(333, size2.height()); 82 EXPECT_EQ(333, size2.height());
83 83
84 ThreadState::current()-> collectAllGarbage(); 84 ThreadHeap::collectAllGarbage();
85 } 85 }
86 86
87 TEST_F(ScrollbarThemeAuraTest, NoButtonsReturnsSize0) 87 TEST_F(ScrollbarThemeAuraTest, NoButtonsReturnsSize0)
88 { 88 {
89 MockScrollableArea* mockScrollableArea = MockScrollableArea::create(); 89 MockScrollableArea* mockScrollableArea = MockScrollableArea::create();
90 ScrollbarThemeMock mockTheme; 90 ScrollbarThemeMock mockTheme;
91 Scrollbar* scrollbar = Scrollbar::createForTesting( 91 Scrollbar* scrollbar = Scrollbar::createForTesting(
92 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme); 92 mockScrollableArea, VerticalScrollbar, RegularScrollbar, &mockTheme);
93 ScrollbarThemeAuraButtonOverride theme; 93 ScrollbarThemeAuraButtonOverride theme;
94 theme.setHasScrollbarButtons(false); 94 theme.setHasScrollbarButtons(false);
95 95
96 scrollbar->setFrameRect(IntRect(1, 2, 3, 4)); 96 scrollbar->setFrameRect(IntRect(1, 2, 3, 4));
97 IntSize size = theme.buttonSize(*scrollbar); 97 IntSize size = theme.buttonSize(*scrollbar);
98 EXPECT_EQ(0, size.width()); 98 EXPECT_EQ(0, size.width());
99 EXPECT_EQ(0, size.height()); 99 EXPECT_EQ(0, size.height());
100 100
101 ThreadState::current()-> collectAllGarbage(); 101 ThreadHeap::collectAllGarbage();
102 } 102 }
103 103
104 } // namespace blink 104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698