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

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

Issue 2338913002: Query compositing state only from UpdateAnimationState (Closed)
Patch Set: Created 4 years, 3 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/ScrollAnimator.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 b645cf3bdeb970a98e3113f03a8e4c4403272aa6..db0174be59df935209876f3fe4d07d25e55a4050 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorTest.cpp
@@ -87,16 +87,6 @@ public:
animator = scrollAnimator;
}
- bool shouldScrollOnMainThread() const override
- {
- return m_scrollOnMainThread;
- }
-
- void setScrollOnMainThread(bool scrollOnMainThread)
- {
- m_scrollOnMainThread = scrollOnMainThread;
- }
-
DoublePoint scrollPositionDouble() const override
{
if (animator)
@@ -123,7 +113,6 @@ private:
: m_scrollAnimatorEnabled(scrollAnimatorEnabled) { }
bool m_scrollAnimatorEnabled;
- bool m_scrollOnMainThread = false;
Member<ScrollAnimator> animator;
};
@@ -167,7 +156,6 @@ static void reset(ScrollAnimator& scrollAnimator)
TEST(ScrollAnimatorTest, MainThreadStates)
{
MockScrollableArea* scrollableArea = MockScrollableArea::create(true);
- scrollableArea->setScrollOnMainThread(true);
ScrollAnimator* scrollAnimator = new ScrollAnimator(scrollableArea, getMockedTime);
EXPECT_CALL(*scrollableArea, minimumScrollPosition()).Times(AtLeast(1))
@@ -175,8 +163,8 @@ TEST(ScrollAnimatorTest, MainThreadStates)
EXPECT_CALL(*scrollableArea, maximumScrollPosition()).Times(AtLeast(1))
.WillRepeatedly(Return(IntPoint(1000, 1000)));
EXPECT_CALL(*scrollableArea, setScrollOffset(_, _)).Times(2);
- // Once from userScroll.
- EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(1);
+ // Once from userScroll, once from updateCompositorAnimations.
+ EXPECT_CALL(*scrollableArea, registerForAnimation()).Times(2);
EXPECT_CALL(*scrollableArea, scheduleAnimation()).Times(AtLeast(1))
.WillRepeatedly(Return(true));
@@ -188,7 +176,7 @@ TEST(ScrollAnimatorTest, MainThreadStates)
// WaitingToSendToCompositor
scrollAnimator->userScroll(ScrollByLine, FloatSize(10, 0));
EXPECT_EQ(scrollAnimator->m_runState,
- ScrollAnimatorCompositorCoordinator::RunState::RunningOnMainThread);
+ ScrollAnimatorCompositorCoordinator::RunState::WaitingToSendToCompositor);
// RunningOnMainThread
gMockedTime += 0.05;
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698