OLD | NEW |
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 Loading... |
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 |
OLD | NEW |