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

Unified Diff: Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp

Issue 7604015: Merge 92639 - Scroll animator changes to nail the framerate (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « Source/WebCore/platform/ScrollAnimatorNone.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp
===================================================================
--- Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp (revision 92726)
+++ Source/WebKit/chromium/tests/ScrollAnimatorNoneTest.cpp (working copy)
@@ -79,8 +79,7 @@
void reset()
{
- stopAnimationTimerIfNeeded(&m_horizontalData);
- stopAnimationTimerIfNeeded(&m_verticalData);
+ stopAnimationTimerIfNeeded();
m_currentPosX = 0;
m_currentPosY = 0;
m_horizontalData.reset();
@@ -93,57 +92,57 @@
TEST(ScrollAnimatorEnabled, Enabled)
{
MockScrollableArea scrollableArea(true);
- MockScrollAnimatorNone scrollAnimatorChromium(&scrollableArea);
+ MockScrollAnimatorNone scrollAnimatorNone(&scrollableArea);
EXPECT_CALL(scrollableArea, scrollSize(_)).Times(AtLeast(1)).WillRepeatedly(Return(1000));
- EXPECT_CALL(scrollableArea, setScrollOffset(_)).Times(AtLeast(1));
+ EXPECT_CALL(scrollableArea, setScrollOffset(_)).Times(3);
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByLine, 100, 1);
- EXPECT_NE(100, scrollAnimatorChromium.currentX());
- EXPECT_NE(0, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByLine, 100, 1);
+ EXPECT_NE(100, scrollAnimatorNone.currentX());
+ EXPECT_NE(0, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByPage, 100, 1);
- EXPECT_NE(100, scrollAnimatorChromium.currentX());
- EXPECT_NE(0, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPage, 100, 1);
+ EXPECT_NE(100, scrollAnimatorNone.currentX());
+ EXPECT_NE(0, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByPixel, 4, 25);
- EXPECT_NE(100, scrollAnimatorChromium.currentX());
- EXPECT_NE(0, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixel, 4, 25);
+ EXPECT_NE(100, scrollAnimatorNone.currentX());
+ EXPECT_NE(0, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
}
TEST(ScrollAnimatorEnabled, Disabled)
{
MockScrollableArea scrollableArea(false);
- MockScrollAnimatorNone scrollAnimatorChromium(&scrollableArea);
+ MockScrollAnimatorNone scrollAnimatorNone(&scrollableArea);
EXPECT_CALL(scrollableArea, scrollSize(_)).Times(AtLeast(1)).WillRepeatedly(Return(1000));
- EXPECT_CALL(scrollableArea, setScrollOffset(_)).Times(AtLeast(1));
+ EXPECT_CALL(scrollableArea, setScrollOffset(_)).Times(4);
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByLine, 100, 1);
- EXPECT_EQ(100, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByLine, 100, 1);
+ EXPECT_EQ(100, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByPage, 100, 1);
- EXPECT_EQ(100, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPage, 100, 1);
+ EXPECT_EQ(100, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByDocument, 100, 1);
- EXPECT_EQ(100, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByDocument, 100, 1);
+ EXPECT_EQ(100, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
- scrollAnimatorChromium.scroll(HorizontalScrollbar, ScrollByPixel, 100, 1);
- EXPECT_EQ(100, scrollAnimatorChromium.currentX());
- EXPECT_EQ(0, scrollAnimatorChromium.currentY());
- scrollAnimatorChromium.reset();
+ scrollAnimatorNone.scroll(HorizontalScrollbar, ScrollByPixel, 100, 1);
+ EXPECT_EQ(100, scrollAnimatorNone.currentX());
+ EXPECT_EQ(0, scrollAnimatorNone.currentY());
+ scrollAnimatorNone.reset();
}
class ScrollAnimatorNoneTest : public testing::Test {
« no previous file with comments | « Source/WebCore/platform/ScrollAnimatorNone.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698