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