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 |