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

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

Issue 2680953002: Remove GraphicsLayer::didScroll and directly call ScrollableArea::didScroll (Closed)
Patch Set: Incorporate reviewer comments: more tests, less bad tests Created 3 years, 10 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 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 "platform/scroll/ScrollableArea.h" 5 #include "platform/scroll/ScrollableArea.h"
6 6
7 #include "platform/graphics/Color.h" 7 #include "platform/graphics/Color.h"
8 #include "platform/graphics/GraphicsLayer.h" 8 #include "platform/graphics/GraphicsLayer.h"
9 #include "platform/scroll/ScrollbarTestSuite.h" 9 #include "platform/scroll/ScrollbarTestSuite.h"
10 #include "platform/scroll/ScrollbarTheme.h" 10 #include "platform/scroll/ScrollbarTheme.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 EXPECT_EQ(ScrollbarOverlayColorThemeDark, 246 EXPECT_EQ(ScrollbarOverlayColorThemeDark,
247 scrollableArea->getScrollbarOverlayColorTheme()); 247 scrollableArea->getScrollbarOverlayColorTheme());
248 scrollableArea->recalculateScrollbarOverlayColorTheme(Color(34, 85, 51)); 248 scrollableArea->recalculateScrollbarOverlayColorTheme(Color(34, 85, 51));
249 EXPECT_EQ(ScrollbarOverlayColorThemeLight, 249 EXPECT_EQ(ScrollbarOverlayColorThemeLight,
250 scrollableArea->getScrollbarOverlayColorTheme()); 250 scrollableArea->getScrollbarOverlayColorTheme());
251 scrollableArea->recalculateScrollbarOverlayColorTheme(Color(236, 143, 185)); 251 scrollableArea->recalculateScrollbarOverlayColorTheme(Color(236, 143, 185));
252 EXPECT_EQ(ScrollbarOverlayColorThemeDark, 252 EXPECT_EQ(ScrollbarOverlayColorThemeDark,
253 scrollableArea->getScrollbarOverlayColorTheme()); 253 scrollableArea->getScrollbarOverlayColorTheme());
254 } 254 }
255 255
256 TEST_F(ScrollableAreaTest, ScrollableAreaDidScroll) {
257 ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
258 platform;
259
260 MockScrollableArea* scrollableArea =
261 MockScrollableArea::create(ScrollOffset(100, 100));
262 scrollableArea->setScrollOrigin(IntPoint(20, 30));
263 scrollableArea->didScroll(gfx::ScrollOffset(40, 51));
264
265 // After calling didScroll, the new offset should account for scroll origin.
266 EXPECT_EQ(20, scrollableArea->scrollOffsetInt().width());
267 EXPECT_EQ(21, scrollableArea->scrollOffsetInt().height());
268 }
269
256 } // namespace blink 270 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698