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

Unified Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1135833002: cc: Ensure pending tree needs prop updates when active tree scrolls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 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/layers/layer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl_unittest.cc
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index f5702d32614d280e6e6bdbafdcf429166d17d2c5..58b4cffd6d36f2d19c3166c66aa60f075293e392 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -4921,6 +4921,41 @@ TEST_F(PictureLayerImplTest, ScrollPastLiveTilesRectAndBack) {
EXPECT_FALSE(active_layer_->HighResTiling()->live_tiles_rect().IsEmpty());
}
+TEST_F(PictureLayerImplTest, ScrollPropagatesToPending) {
+ base::TimeTicks time_ticks;
+ time_ticks += base::TimeDelta::FromMilliseconds(1);
+ host_impl_.SetCurrentBeginFrameArgs(
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
+
+ gfx::Size tile_size(102, 102);
+ gfx::Size layer_bounds(1000, 1000);
+ gfx::Size viewport_size(100, 100);
+
+ host_impl_.SetViewportSize(viewport_size);
+ host_impl_.SetDeviceScaleFactor(1.f);
+
+ scoped_refptr<FakePicturePileImpl> pending_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+ scoped_refptr<FakePicturePileImpl> active_pile =
+ FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds);
+
+ SetupTrees(pending_pile, active_pile);
+
+ active_layer_->SetCurrentScrollOffset(gfx::ScrollOffset(0.0, 50.0));
+ host_impl_.active_tree()->UpdateDrawProperties(false);
+ EXPECT_EQ("0,50 100x100", active_layer_->HighResTiling()
+ ->GetCurrentVisibleRectForTesting()
+ .ToString());
+
+ EXPECT_EQ("0,0 100x100", pending_layer_->HighResTiling()
+ ->GetCurrentVisibleRectForTesting()
+ .ToString());
+ host_impl_.pending_tree()->UpdateDrawProperties(false);
+ EXPECT_EQ("0,50 100x100", pending_layer_->HighResTiling()
vmpstr 2015/05/11 18:36:15 This part fails without the patch, and passes with
+ ->GetCurrentVisibleRectForTesting()
+ .ToString());
+}
+
TEST_F(PictureLayerImplTest, UpdateLCDInvalidatesPendingTree) {
base::TimeTicks time_ticks;
time_ticks += base::TimeDelta::FromMilliseconds(1);
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698