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

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

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "config.h" 5 #include "config.h"
6 #include "platform/scroll/ScrollableArea.h" 6 #include "platform/scroll/ScrollableArea.h"
7 7
8 #include "platform/scroll/ScrollbarTheme.h" 8 #include "platform/scroll/ScrollbarTheme.h"
9 #include "platform/scroll/ScrollbarThemeMock.h" 9 #include "platform/scroll/ScrollbarThemeMock.h"
10 #include "platform/testing/TestingPlatformSupport.h" 10 #include "platform/testing/TestingPlatformSupport.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 private: 120 private:
121 FakePlatform m_fakePlatform; 121 FakePlatform m_fakePlatform;
122 Platform* m_oldPlatform; // Not owned. 122 Platform* m_oldPlatform; // Not owned.
123 }; 123 };
124 124
125 TEST_F(ScrollableAreaTest, ScrollAnimatorCurrentPositionShouldBeSync) 125 TEST_F(ScrollableAreaTest, ScrollAnimatorCurrentPositionShouldBeSync)
126 { 126 {
127 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100)); 127 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100));
128 scrollableArea->setScrollPosition(IntPoint(0, 10000), CompositorScroll); 128 scrollableArea->setScrollPosition(IntPoint(0, 10000), CompositorScroll);
129 EXPECT_EQ(100.0, scrollableArea->scrollAnimator()->currentPosition().y()); 129 EXPECT_EQ(100.0, scrollableArea->scrollAnimator().currentPosition().y());
130 } 130 }
131 131
132 TEST_F(ScrollableAreaTest, ScrollbarTrackAndThumbRepaint) 132 TEST_F(ScrollableAreaTest, ScrollbarTrackAndThumbRepaint)
133 { 133 {
134 ScrollbarTheme::setMockScrollbarsEnabled(true); 134 ScrollbarTheme::setMockScrollbarsEnabled(true);
135 ScrollbarThemeMock::setShouldRepaintAllPartsOnInvalidation(true); 135 ScrollbarThemeMock::setShouldRepaintAllPartsOnInvalidation(true);
136 136
137 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100)); 137 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea:: create(IntPoint(0, 100));
138 RefPtrWillBeRawPtr<Scrollbar> scrollbar = Scrollbar::create(scrollableArea.g et(), HorizontalScrollbar, RegularScrollbar); 138 RefPtrWillBeRawPtr<Scrollbar> scrollbar = Scrollbar::create(scrollableArea.g et(), HorizontalScrollbar, RegularScrollbar);
139 139
(...skipping 15 matching lines...) Expand all
155 scrollbar->setTrackNeedsRepaint(false); 155 scrollbar->setTrackNeedsRepaint(false);
156 scrollbar->setThumbNeedsRepaint(false); 156 scrollbar->setThumbNeedsRepaint(false);
157 EXPECT_FALSE(scrollbar->trackNeedsRepaint()); 157 EXPECT_FALSE(scrollbar->trackNeedsRepaint());
158 EXPECT_FALSE(scrollbar->thumbNeedsRepaint()); 158 EXPECT_FALSE(scrollbar->thumbNeedsRepaint());
159 scrollbar->setNeedsPaintInvalidation(); 159 scrollbar->setNeedsPaintInvalidation();
160 EXPECT_FALSE(scrollbar->trackNeedsRepaint()); 160 EXPECT_FALSE(scrollbar->trackNeedsRepaint());
161 EXPECT_FALSE(scrollbar->thumbNeedsRepaint()); 161 EXPECT_FALSE(scrollbar->thumbNeedsRepaint());
162 } 162 }
163 163
164 } // namespace blink 164 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698