| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "platform/scroll/ScrollableArea.h" | 35 #include "platform/scroll/ScrollableArea.h" |
| 36 #include <gmock/gmock.h> | 36 #include <gmock/gmock.h> |
| 37 #include <gtest/gtest.h> | 37 #include <gtest/gtest.h> |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 using testing::AtLeast; | 41 using testing::AtLeast; |
| 42 using testing::Return; | 42 using testing::Return; |
| 43 using testing::_; | 43 using testing::_; |
| 44 | 44 |
| 45 class MockScrollableArea : public ScrollableArea { | 45 class MockScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<MockScro
llableArea>, public ScrollableArea { |
| 46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MockScrollableArea); |
| 46 public: | 47 public: |
| 47 MockScrollableArea(bool scrollAnimatorEnabled) | 48 static PassOwnPtrWillBeRawPtr<MockScrollableArea> create(bool scrollAnimator
Enabled) |
| 48 : m_scrollAnimatorEnabled(scrollAnimatorEnabled) { } | 49 { |
| 50 return adoptPtrWillBeNoop(new MockScrollableArea(scrollAnimatorEnabled))
; |
| 51 } |
| 49 | 52 |
| 50 MOCK_CONST_METHOD0(isActive, bool()); | 53 MOCK_CONST_METHOD0(isActive, bool()); |
| 51 MOCK_CONST_METHOD1(scrollSize, int(ScrollbarOrientation)); | 54 MOCK_CONST_METHOD1(scrollSize, int(ScrollbarOrientation)); |
| 52 MOCK_METHOD2(invalidateScrollbar, void(Scrollbar*, const IntRect&)); | 55 MOCK_METHOD2(invalidateScrollbar, void(Scrollbar*, const IntRect&)); |
| 53 MOCK_CONST_METHOD0(isScrollCornerVisible, bool()); | 56 MOCK_CONST_METHOD0(isScrollCornerVisible, bool()); |
| 54 MOCK_CONST_METHOD0(scrollCornerRect, IntRect()); | 57 MOCK_CONST_METHOD0(scrollCornerRect, IntRect()); |
| 55 MOCK_METHOD2(setScrollOffset, void(const IntPoint&, ScrollType)); | 58 MOCK_METHOD2(setScrollOffset, void(const IntPoint&, ScrollType)); |
| 56 MOCK_METHOD2(invalidateScrollbarRect, void(Scrollbar*, const IntRect&)); | 59 MOCK_METHOD2(invalidateScrollbarRect, void(Scrollbar*, const IntRect&)); |
| 57 MOCK_METHOD1(invalidateScrollCornerRect, void(const IntRect&)); | 60 MOCK_METHOD1(invalidateScrollCornerRect, void(const IntRect&)); |
| 58 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); | 61 MOCK_CONST_METHOD0(enclosingScrollableArea, ScrollableArea*()); |
| 59 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint()); | 62 MOCK_CONST_METHOD0(minimumScrollPosition, IntPoint()); |
| 60 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint()); | 63 MOCK_CONST_METHOD0(maximumScrollPosition, IntPoint()); |
| 61 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect)); | 64 MOCK_CONST_METHOD1(visibleContentRect, IntRect(IncludeScrollbarsInRect)); |
| 62 MOCK_CONST_METHOD0(contentsSize, IntSize()); | 65 MOCK_CONST_METHOD0(contentsSize, IntSize()); |
| 63 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool()); | 66 MOCK_CONST_METHOD0(scrollbarsCanBeActive, bool()); |
| 64 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); | 67 MOCK_CONST_METHOD0(scrollableAreaBoundingBox, IntRect()); |
| 65 | 68 |
| 66 virtual bool userInputScrollable(ScrollbarOrientation) const override { retu
rn true; } | 69 virtual bool userInputScrollable(ScrollbarOrientation) const override { retu
rn true; } |
| 67 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override { return fa
lse; } | 70 virtual bool shouldPlaceVerticalScrollbarOnLeft() const override { return fa
lse; } |
| 68 virtual IntPoint scrollPosition() const override { return IntPoint(); } | 71 virtual IntPoint scrollPosition() const override { return IntPoint(); } |
| 69 virtual int visibleHeight() const override { return 768; } | 72 virtual int visibleHeight() const override { return 768; } |
| 70 virtual int visibleWidth() const override { return 1024; } | 73 virtual int visibleWidth() const override { return 1024; } |
| 71 virtual bool scrollAnimatorEnabled() const override { return m_scrollAnimato
rEnabled; } | 74 virtual bool scrollAnimatorEnabled() const override { return m_scrollAnimato
rEnabled; } |
| 72 virtual int pageStep(ScrollbarOrientation) const override { return 0; } | 75 virtual int pageStep(ScrollbarOrientation) const override { return 0; } |
| 73 | 76 |
| 77 DEFINE_INLINE_VIRTUAL_TRACE() |
| 78 { |
| 79 ScrollableArea::trace(visitor); |
| 80 } |
| 81 |
| 74 private: | 82 private: |
| 83 explicit MockScrollableArea(bool scrollAnimatorEnabled) |
| 84 : m_scrollAnimatorEnabled(scrollAnimatorEnabled) { } |
| 85 |
| 75 bool m_scrollAnimatorEnabled; | 86 bool m_scrollAnimatorEnabled; |
| 76 }; | 87 }; |
| 77 | 88 |
| 78 class MockScrollAnimatorNone : public ScrollAnimatorNone { | 89 class MockScrollAnimatorNone : public ScrollAnimatorNone { |
| 79 public: | 90 public: |
| 80 static PassRefPtr<MockScrollAnimatorNone> create(ScrollableArea* scrollableA
rea) | 91 static PassOwnPtr<MockScrollAnimatorNone> create(ScrollableArea* scrollableA
rea) |
| 81 { | 92 { |
| 82 return adoptRef(new MockScrollAnimatorNone(scrollableArea)); | 93 return adoptPtr(new MockScrollAnimatorNone(scrollableArea)); |
| 83 } | 94 } |
| 84 | 95 |
| 85 float currentX() { return m_currentPosX; } | 96 float currentX() { return m_currentPosX; } |
| 86 float currentY() { return m_currentPosY; } | 97 float currentY() { return m_currentPosY; } |
| 87 | 98 |
| 88 FloatPoint m_fp; | 99 FloatPoint m_fp; |
| 89 int m_count; | 100 int m_count; |
| 90 | 101 |
| 91 void reset() | 102 void reset() |
| 92 { | 103 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 106 } | 117 } |
| 107 | 118 |
| 108 private: | 119 private: |
| 109 explicit MockScrollAnimatorNone(ScrollableArea* scrollableArea) | 120 explicit MockScrollAnimatorNone(ScrollableArea* scrollableArea) |
| 110 : ScrollAnimatorNone(scrollableArea) { } | 121 : ScrollAnimatorNone(scrollableArea) { } |
| 111 | 122 |
| 112 }; | 123 }; |
| 113 | 124 |
| 114 TEST(ScrollAnimatorEnabled, Enabled) | 125 TEST(ScrollAnimatorEnabled, Enabled) |
| 115 { | 126 { |
| 116 MockScrollableArea scrollableArea(true); | 127 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea::
create(true); |
| 117 RefPtr<MockScrollAnimatorNone> scrollAnimatorNone = MockScrollAnimatorNone::
create(&scrollableArea); | 128 OwnPtr<MockScrollAnimatorNone> scrollAnimatorNone = MockScrollAnimatorNone::
create(scrollableArea.get()); |
| 118 | 129 |
| 119 EXPECT_CALL(scrollableArea, scrollSize(_)).Times(AtLeast(1)).WillRepeatedly(
Return(1000)); | 130 EXPECT_CALL(*scrollableArea, scrollSize(_)).Times(AtLeast(1)).WillRepeatedly
(Return(1000)); |
| 120 EXPECT_CALL(scrollableArea, minimumScrollPosition()).Times(AtLeast(1)).WillR
epeatedly(Return(IntPoint())); | 131 EXPECT_CALL(*scrollableArea, minimumScrollPosition()).Times(AtLeast(1)).Will
Repeatedly(Return(IntPoint())); |
| 121 EXPECT_CALL(scrollableArea, maximumScrollPosition()).Times(AtLeast(1)).WillR
epeatedly(Return(IntPoint(1000, 1000))); | 132 EXPECT_CALL(*scrollableArea, maximumScrollPosition()).Times(AtLeast(1)).Will
Repeatedly(Return(IntPoint(1000, 1000))); |
| 122 EXPECT_CALL(scrollableArea, setScrollOffset(_, _)).Times(4); | 133 EXPECT_CALL(*scrollableArea, setScrollOffset(_, _)).Times(4); |
| 123 | 134 |
| 124 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByLine, 100, 1); | 135 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByLine, 100, 1); |
| 125 EXPECT_NE(100, scrollAnimatorNone->currentX()); | 136 EXPECT_NE(100, scrollAnimatorNone->currentX()); |
| 126 EXPECT_NE(0, scrollAnimatorNone->currentX()); | 137 EXPECT_NE(0, scrollAnimatorNone->currentX()); |
| 127 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 138 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 128 scrollAnimatorNone->reset(); | 139 scrollAnimatorNone->reset(); |
| 129 | 140 |
| 130 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPage, 100, 1); | 141 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPage, 100, 1); |
| 131 EXPECT_NE(100, scrollAnimatorNone->currentX()); | 142 EXPECT_NE(100, scrollAnimatorNone->currentX()); |
| 132 EXPECT_NE(0, scrollAnimatorNone->currentX()); | 143 EXPECT_NE(0, scrollAnimatorNone->currentX()); |
| 133 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 144 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 134 scrollAnimatorNone->reset(); | 145 scrollAnimatorNone->reset(); |
| 135 | 146 |
| 136 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPixel, 4, 25); | 147 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPixel, 4, 25); |
| 137 EXPECT_NE(100, scrollAnimatorNone->currentX()); | 148 EXPECT_NE(100, scrollAnimatorNone->currentX()); |
| 138 EXPECT_NE(0, scrollAnimatorNone->currentX()); | 149 EXPECT_NE(0, scrollAnimatorNone->currentX()); |
| 139 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 150 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 140 scrollAnimatorNone->reset(); | 151 scrollAnimatorNone->reset(); |
| 141 | 152 |
| 142 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPrecisePixel, 4,
25); | 153 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPrecisePixel, 4,
25); |
| 143 EXPECT_EQ(100, scrollAnimatorNone->currentX()); | 154 EXPECT_EQ(100, scrollAnimatorNone->currentX()); |
| 144 EXPECT_NE(0, scrollAnimatorNone->currentX()); | 155 EXPECT_NE(0, scrollAnimatorNone->currentX()); |
| 145 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 156 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 146 scrollAnimatorNone->reset(); | 157 scrollAnimatorNone->reset(); |
| 147 } | 158 } |
| 148 | 159 |
| 149 TEST(ScrollAnimatorEnabled, Disabled) | 160 TEST(ScrollAnimatorEnabled, Disabled) |
| 150 { | 161 { |
| 151 MockScrollableArea scrollableArea(false); | 162 OwnPtrWillBeRawPtr<MockScrollableArea> scrollableArea = MockScrollableArea::
create(false); |
| 152 RefPtr<MockScrollAnimatorNone> scrollAnimatorNone = MockScrollAnimatorNone::
create(&scrollableArea); | 163 OwnPtr<MockScrollAnimatorNone> scrollAnimatorNone = MockScrollAnimatorNone::
create(scrollableArea.get()); |
| 153 | 164 |
| 154 EXPECT_CALL(scrollableArea, minimumScrollPosition()).Times(AtLeast(1)).WillR
epeatedly(Return(IntPoint())); | 165 EXPECT_CALL(*scrollableArea, minimumScrollPosition()).Times(AtLeast(1)).Will
Repeatedly(Return(IntPoint())); |
| 155 EXPECT_CALL(scrollableArea, maximumScrollPosition()).Times(AtLeast(1)).WillR
epeatedly(Return(IntPoint(1000, 1000))); | 166 EXPECT_CALL(*scrollableArea, maximumScrollPosition()).Times(AtLeast(1)).Will
Repeatedly(Return(IntPoint(1000, 1000))); |
| 156 EXPECT_CALL(scrollableArea, setScrollOffset(_, _)).Times(4); | 167 EXPECT_CALL(*scrollableArea, setScrollOffset(_, _)).Times(4); |
| 157 | 168 |
| 158 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByLine, 100, 1); | 169 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByLine, 100, 1); |
| 159 EXPECT_EQ(100, scrollAnimatorNone->currentX()); | 170 EXPECT_EQ(100, scrollAnimatorNone->currentX()); |
| 160 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 171 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 161 scrollAnimatorNone->reset(); | 172 scrollAnimatorNone->reset(); |
| 162 | 173 |
| 163 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPage, 100, 1); | 174 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPage, 100, 1); |
| 164 EXPECT_EQ(100, scrollAnimatorNone->currentX()); | 175 EXPECT_EQ(100, scrollAnimatorNone->currentX()); |
| 165 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 176 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 166 scrollAnimatorNone->reset(); | 177 scrollAnimatorNone->reset(); |
| 167 | 178 |
| 168 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByDocument, 100, 1
); | 179 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByDocument, 100, 1
); |
| 169 EXPECT_EQ(100, scrollAnimatorNone->currentX()); | 180 EXPECT_EQ(100, scrollAnimatorNone->currentX()); |
| 170 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 181 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 171 scrollAnimatorNone->reset(); | 182 scrollAnimatorNone->reset(); |
| 172 | 183 |
| 173 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPixel, 100, 1); | 184 scrollAnimatorNone->userScroll(HorizontalScrollbar, ScrollByPixel, 100, 1); |
| 174 EXPECT_EQ(100, scrollAnimatorNone->currentX()); | 185 EXPECT_EQ(100, scrollAnimatorNone->currentX()); |
| 175 EXPECT_EQ(0, scrollAnimatorNone->currentY()); | 186 EXPECT_EQ(0, scrollAnimatorNone->currentY()); |
| 176 scrollAnimatorNone->reset(); | 187 scrollAnimatorNone->reset(); |
| 177 } | 188 } |
| 178 | 189 |
| 179 class ScrollAnimatorNoneTest : public testing::Test { | 190 class ScrollAnimatorNoneTest : public testing::Test { |
| 180 public: | 191 public: |
| 181 struct SavePerAxisData : public ScrollAnimatorNone::PerAxisData { | 192 struct SavePerAxisData : public ScrollAnimatorNone::PerAxisData { |
| 182 SavePerAxisData(const ScrollAnimatorNone::PerAxisData& data) | 193 SavePerAxisData(const ScrollAnimatorNone::PerAxisData& data) |
| 183 : ScrollAnimatorNone::PerAxisData(0, 768) | 194 : ScrollAnimatorNone::PerAxisData(0, 768) |
| 184 , m_mockScrollableArea(true) | 195 , m_mockScrollableArea(MockScrollableArea::create(true)) |
| 185 , m_mockScrollAnimatorNone(MockScrollAnimatorNone::create(&m_mockScr
ollableArea)) | 196 , m_mockScrollAnimatorNone(MockScrollAnimatorNone::create(m_mockScro
llableArea.get())) |
| 186 { | 197 { |
| 187 this->m_currentVelocity = data.m_currentVelocity; | 198 this->m_currentVelocity = data.m_currentVelocity; |
| 188 this->m_desiredPosition = data.m_desiredPosition; | 199 this->m_desiredPosition = data.m_desiredPosition; |
| 189 this->m_desiredVelocity = data.m_desiredVelocity; | 200 this->m_desiredVelocity = data.m_desiredVelocity; |
| 190 this->m_startPosition = data.m_startPosition; | 201 this->m_startPosition = data.m_startPosition; |
| 191 this->m_startTime = data.m_startTime; | 202 this->m_startTime = data.m_startTime; |
| 192 this->m_startVelocity = data.m_startVelocity; | 203 this->m_startVelocity = data.m_startVelocity; |
| 193 this->m_animationTime = data.m_animationTime; | 204 this->m_animationTime = data.m_animationTime; |
| 194 this->m_lastAnimationTime = data.m_lastAnimationTime; | 205 this->m_lastAnimationTime = data.m_lastAnimationTime; |
| 195 this->m_attackPosition = data.m_attackPosition; | 206 this->m_attackPosition = data.m_attackPosition; |
| 196 this->m_attackTime = data.m_attackTime; | 207 this->m_attackTime = data.m_attackTime; |
| 197 this->m_attackCurve = data.m_attackCurve; | 208 this->m_attackCurve = data.m_attackCurve; |
| 198 this->m_releasePosition = data.m_releasePosition; | 209 this->m_releasePosition = data.m_releasePosition; |
| 199 this->m_releaseTime = data.m_releaseTime; | 210 this->m_releaseTime = data.m_releaseTime; |
| 200 this->m_releaseCurve = data.m_releaseCurve; | 211 this->m_releaseCurve = data.m_releaseCurve; |
| 201 } | 212 } |
| 202 | 213 |
| 203 bool operator==(const SavePerAxisData& other) const | 214 bool operator==(const SavePerAxisData& other) const |
| 204 { | 215 { |
| 205 return m_currentVelocity == other.m_currentVelocity && m_desiredPosi
tion == other.m_desiredPosition && m_desiredVelocity == other.m_desiredVelocity
&& m_startPosition == other.m_startPosition && m_startTime == other.m_startTime
&& m_startVelocity == other.m_startVelocity && m_animationTime == other.m_animat
ionTime && m_lastAnimationTime == other.m_lastAnimationTime && m_attackPosition
== other.m_attackPosition && m_attackTime == other.m_attackTime && m_attackCurve
== other.m_attackCurve && m_releasePosition == other.m_releasePosition && m_rel
easeTime == other.m_releaseTime && m_releaseCurve == other.m_releaseCurve; | 216 return m_currentVelocity == other.m_currentVelocity && m_desiredPosi
tion == other.m_desiredPosition && m_desiredVelocity == other.m_desiredVelocity
&& m_startPosition == other.m_startPosition && m_startTime == other.m_startTime
&& m_startVelocity == other.m_startVelocity && m_animationTime == other.m_animat
ionTime && m_lastAnimationTime == other.m_lastAnimationTime && m_attackPosition
== other.m_attackPosition && m_attackTime == other.m_attackTime && m_attackCurve
== other.m_attackCurve && m_releasePosition == other.m_releasePosition && m_rel
easeTime == other.m_releaseTime && m_releaseCurve == other.m_releaseCurve; |
| 206 } | 217 } |
| 207 MockScrollableArea m_mockScrollableArea; | 218 OwnPtrWillBePersistent<MockScrollableArea> m_mockScrollableArea; |
| 208 RefPtr<MockScrollAnimatorNone> m_mockScrollAnimatorNone; | 219 OwnPtr<MockScrollAnimatorNone> m_mockScrollAnimatorNone; |
| 209 }; | 220 }; |
| 210 | 221 |
| 211 ScrollAnimatorNoneTest() | 222 ScrollAnimatorNoneTest() |
| 212 : m_mockScrollableArea(true) | 223 : m_mockScrollableArea(MockScrollableArea::create(true)) |
| 213 , m_mockScrollAnimatorNone(MockScrollAnimatorNone::create(&m_mockScrolla
bleArea)) | 224 , m_mockScrollAnimatorNone(MockScrollAnimatorNone::create(m_mockScrollab
leArea.get())) |
| 214 { | 225 { |
| 215 } | 226 } |
| 216 | 227 |
| 217 void SetUp() override | 228 void SetUp() override |
| 218 { | 229 { |
| 219 m_currentPosition = 100; | 230 m_currentPosition = 100; |
| 220 m_data = new ScrollAnimatorNone::PerAxisData(&m_currentPosition, 768); | 231 m_data = new ScrollAnimatorNone::PerAxisData(&m_currentPosition, 768); |
| 221 } | 232 } |
| 222 void TearDown() override | 233 void TearDown() override |
| 223 { | 234 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 238 void curveTest(ScrollAnimatorNone::Curve); | 249 void curveTest(ScrollAnimatorNone::Curve); |
| 239 | 250 |
| 240 void checkDesiredPosition(float expectedPosition); | 251 void checkDesiredPosition(float expectedPosition); |
| 241 void checkSoftLanding(float expectedPosition); | 252 void checkSoftLanding(float expectedPosition); |
| 242 | 253 |
| 243 static double kTickTime; | 254 static double kTickTime; |
| 244 static double kAnimationTime; | 255 static double kAnimationTime; |
| 245 static double kStartTime; | 256 static double kStartTime; |
| 246 static double kEndTime; | 257 static double kEndTime; |
| 247 float m_currentPosition; | 258 float m_currentPosition; |
| 248 MockScrollableArea m_mockScrollableArea; | 259 OwnPtrWillBePersistent<MockScrollableArea> m_mockScrollableArea; |
| 249 RefPtr<MockScrollAnimatorNone> m_mockScrollAnimatorNone; | 260 OwnPtr<MockScrollAnimatorNone> m_mockScrollAnimatorNone; |
| 250 bool m_scrollingDown; | 261 bool m_scrollingDown; |
| 251 ScrollAnimatorNone::PerAxisData* m_data; | 262 ScrollAnimatorNone::PerAxisData* m_data; |
| 252 }; | 263 }; |
| 253 | 264 |
| 254 double ScrollAnimatorNoneTest::kTickTime = 1 / 60.0; | 265 double ScrollAnimatorNoneTest::kTickTime = 1 / 60.0; |
| 255 double ScrollAnimatorNoneTest::kAnimationTime = 0.01; | 266 double ScrollAnimatorNoneTest::kAnimationTime = 0.01; |
| 256 double ScrollAnimatorNoneTest::kStartTime = 10.0; | 267 double ScrollAnimatorNoneTest::kStartTime = 10.0; |
| 257 double ScrollAnimatorNoneTest::kEndTime = 20.0; | 268 double ScrollAnimatorNoneTest::kEndTime = 20.0; |
| 258 | 269 |
| 259 void ScrollAnimatorNoneTest::reset() | 270 void ScrollAnimatorNoneTest::reset() |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 double after = m_currentPosition; | 1058 double after = m_currentPosition; |
| 1048 EXPECT_GE(before, after); | 1059 EXPECT_GE(before, after); |
| 1049 | 1060 |
| 1050 t += kAnimationTime; | 1061 t += kAnimationTime; |
| 1051 for (; result && t < kEndTime; t += kAnimationTime) | 1062 for (; result && t < kEndTime; t += kAnimationTime) |
| 1052 result = result && animateScroll(t); | 1063 result = result && animateScroll(t); |
| 1053 EXPECT_GE(before, m_currentPosition); | 1064 EXPECT_GE(before, m_currentPosition); |
| 1054 } | 1065 } |
| 1055 | 1066 |
| 1056 } // namespace blink | 1067 } // namespace blink |
| OLD | NEW |