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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
index 4909395535fb453198ee5dccb0ab8cf38b4ef2da..3a7b40b78c6a069ba2f8b421177a98886859a035 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
@@ -253,4 +253,18 @@ TEST_F(ScrollableAreaTest, RecalculatesScrollbarOverlayIfBackgroundChanges) {
scrollableArea->getScrollbarOverlayColorTheme());
}
+TEST_F(ScrollableAreaTest, ScrollableAreaDidScroll) {
+ ScopedTestingPlatformSupport<TestingPlatformSupportWithMockScheduler>
+ platform;
+
+ MockScrollableArea* scrollableArea =
+ MockScrollableArea::create(ScrollOffset(100, 100));
+ scrollableArea->setScrollOrigin(IntPoint(20, 30));
+ scrollableArea->didScroll(gfx::ScrollOffset(40, 51));
+
+ // After calling didScroll, the new offset should account for scroll origin.
+ EXPECT_EQ(20, scrollableArea->scrollOffsetInt().width());
+ EXPECT_EQ(21, scrollableArea->scrollOffsetInt().height());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698