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

Unified Diff: cc/trees/layer_tree_host_unittest_animation.cc

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 | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.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 b6674fc0df84281faad4843121709b9d8de1c5e6..f2e2ca7ea67814def6e9e3354278667a442fb46f 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -779,11 +779,17 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationTakeover
void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void DidCommit() override {
- // Add a main thread scrolling reason after the first commit to trigger
- // the takeover path.
if (layer_tree_host()->source_frame_number() == 1) {
- scroll_layer_->AddMainThreadScrollingReasons(
- MainThreadScrollingReason::kHasNonLayerViewportConstrainedObjects);
+ // Add an update after the first commit to trigger the animation takeover
+ // path.
+ layer_tree_host()
+ ->animation_host()
+ ->scroll_offset_animations()
+ .AddTakeoverUpdate(scroll_layer_->id());
+ EXPECT_TRUE(layer_tree_host()
+ ->animation_host()
+ ->scroll_offset_animations()
+ .HasUpdatesForTesting());
}
}
@@ -837,12 +843,11 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted
if (layer_tree_host()->source_frame_number() == 1) {
// Add an update after the first commit to trigger the animation update
// path.
- ScrollOffsetAnimationUpdate update(
- ScrollOffsetAnimationUpdate::Type::SCROLL_OFFSET_CHANGED,
- scroll_layer_->id());
- update.adjustment_ = gfx::Vector2dF(100.f, 100.f);
- layer_tree_host()->animation_host()->scroll_offset_animations().AddUpdate(
- update);
+ layer_tree_host()
+ ->animation_host()
+ ->scroll_offset_animations()
+ .AddAdjustmentUpdate(scroll_layer_->id(),
+ gfx::Vector2dF(100.f, 100.f));
EXPECT_TRUE(layer_tree_host()
->animation_host()
->scroll_offset_animations()
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698