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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp

Issue 2006103004: Send takeover msg from MT to CC using the animation path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: jbroman nits Created 4 years, 7 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 | « third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
index 60cbd81283394626de3ce6814cdfbb45b4814a1d..faad7bbd1e36dc3acb7335389be26c3044da53a1 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
@@ -314,7 +314,7 @@ TEST(ScrollAnimatorTest, AnimatedScrollTakeover)
.WillRepeatedly(Return(IntPoint(1000, 1000)));
EXPECT_CALL(*scrollableArea, setScrollOffset(_, _)).Times(2);
// Called from userScroll, updateCompositorAnimations, then
- // takeoverCompositorAnimation (to re-register after RunningOnCompositor).
+ // takeOverCompositorAnimation (to re-register after RunningOnCompositor).
EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(3);
EXPECT_CALL(*scrollableArea, scheduleAnimation()).Times(AtLeast(1))
.WillRepeatedly(Return(true));
@@ -336,7 +336,7 @@ TEST(ScrollAnimatorTest, AnimatedScrollTakeover)
ScrollAnimatorCompositorCoordinator::RunState::RunningOnCompositor);
// Takeover.
- scrollAnimator->takeoverCompositorAnimation();
+ scrollAnimator->takeOverCompositorAnimation();
EXPECT_EQ(scrollAnimator->m_runState,
ScrollAnimatorCompositorCoordinator::RunState::RunningOnCompositorButNeedsTakeover);
@@ -519,21 +519,23 @@ TEST(ScrollAnimatorTest, CancellingCompositorAnimation)
ThreadHeap::collectAllGarbage();
}
-// This test verifies that ImplOnlyAnimationUpdate gets cleared once its
-// pushed to compositor animation host.
+// This test verifies that impl only animation updates get cleared once they
+// are pushed to compositor animation host.
TEST(ScrollAnimatorTest, ImplOnlyAnimationUpdatesCleared)
{
MockScrollableArea* scrollableArea = MockScrollableArea::create(true);
TestScrollAnimator* animator = new TestScrollAnimator(scrollableArea, getMockedTime);
- EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(2);
+ // From calls to adjust/takeoverImplOnlyScrollOffsetAnimation.
+ EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(3);
+ // Verify that the adjustment update is cleared.
EXPECT_EQ(animator->m_runState, ScrollAnimatorCompositorCoordinator::RunState::Idle);
EXPECT_FALSE(animator->hasAnimationThatRequiresService());
EXPECT_TRUE(animator->implOnlyAnimationAdjustmentForTesting().isZero());
- animator->updateImplOnlyScrollOffsetAnimation(FloatSize(100.f, 100.f));
- animator->updateImplOnlyScrollOffsetAnimation(FloatSize(10.f, -10.f));
+ animator->adjustImplOnlyScrollOffsetAnimation(FloatSize(100.f, 100.f));
+ animator->adjustImplOnlyScrollOffsetAnimation(FloatSize(10.f, -10.f));
EXPECT_TRUE(animator->hasAnimationThatRequiresService());
EXPECT_EQ(FloatSize(110.f, 90.f), animator->implOnlyAnimationAdjustmentForTesting());
@@ -544,6 +546,12 @@ TEST(ScrollAnimatorTest, ImplOnlyAnimationUpdatesCleared)
EXPECT_FALSE(animator->hasAnimationThatRequiresService());
EXPECT_TRUE(animator->implOnlyAnimationAdjustmentForTesting().isZero());
+ // Verify that the takeover update is cleared.
+ animator->takeOverImplOnlyScrollOffsetAnimation();
+ EXPECT_TRUE(animator->hasAnimationThatRequiresService());
+ animator->updateCompositorAnimations();
+ EXPECT_FALSE(animator->hasAnimationThatRequiresService());
+
// Forced GC in order to finalize objects depending on the mock object.
ThreadHeap::collectAllGarbage();
}
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698