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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

Issue 368883003: cc: Disallow scroll offset animations when impl-scrolling isn't supported (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_animation.cc
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index 1542a1417b42e508f348affaee33d551e905246b..64dd31d2c931fd7c2dfb3e3a8fa61512c1b5bbde 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -1073,8 +1073,9 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
MULTI_THREAD_TEST_F(
LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations);
-// Verifies that when scroll offset is animated on the impl thread, updates
-// are sent back to the main thread.
+// Verifies that scroll offset animations are only accepted when impl-scrolling
+// is supported, and that when scroll offset animations are accepted,
+// scroll offset updates are sent back to the main thread.
class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
: public LayerTreeHostAnimationTest {
public:
@@ -1104,7 +1105,12 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
scoped_ptr<Animation> animation(Animation::Create(
curve.PassAs<AnimationCurve>(), 1, 0, Animation::ScrollOffset));
animation->set_needs_synchronized_start_time(true);
- scroll_layer_->AddAnimation(animation.Pass());
+ bool animation_added = scroll_layer_->AddAnimation(animation.Pass());
+ bool impl_scrolling_supported =
+ layer_tree_host()->proxy()->SupportsImplScrolling();
+ EXPECT_EQ(impl_scrolling_supported, animation_added);
+ if (!impl_scrolling_supported)
+ EndTest();
break;
}
default:
@@ -1121,9 +1127,8 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated
scoped_refptr<FakeContentLayer> scroll_layer_;
};
-// SingleThreadProxy doesn't send scroll updates from LayerTreeHostImpl to
-// LayerTreeHost.
-MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestScrollOffsetChangesArePropagated);
+SINGLE_AND_MULTI_THREAD_TEST_F(
+ LayerTreeHostAnimationTestScrollOffsetChangesArePropagated);
// Ensure that animation time is correctly updated when animations are frozen
// because of checkerboarding.
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698