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

Unified Diff: cc/trees/layer_tree_host_unittest_picture.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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_unittest_damage.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_picture.cc
diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc
index 773798acf9bdbb9828eaf7f0404b4bb5d77c2b15..159200a2df13eaad8df6481ce1b2bd2889f6dcba 100644
--- a/cc/trees/layer_tree_host_unittest_picture.cc
+++ b/cc/trees/layer_tree_host_unittest_picture.cc
@@ -44,16 +44,30 @@ class LayerTreeHostPictureTestTwinLayer
void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
+ case 1:
+ // Activate while there are pending and active twins in place.
+ layer_tree_host()->SetNeedsCommit();
+ break;
case 2:
- // Drop the picture layer from the tree.
+ // Drop the picture layer from the tree so the activate will have an
+ // active layer without a pending twin.
layer_tree_host()->root_layer()->children()[0]->RemoveFromParent();
break;
- case 3:
- // Add a new picture layer.
+ case 3: {
+ // Add a new picture layer so the activate will have a pending layer
+ // without an active twin.
scoped_refptr<FakePictureLayer> picture =
FakePictureLayer::Create(&client_);
layer_tree_host()->root_layer()->AddChild(picture);
break;
+ }
+ case 4:
+ // Active while there are pending and active twins again.
+ layer_tree_host()->SetNeedsCommit();
+ break;
+ case 5:
+ EndTest();
+ break;
}
}
@@ -87,7 +101,7 @@ class LayerTreeHostPictureTestTwinLayer
// After the first activation, when we commit again, we'll have a pending
// and active layer. Then we recreate a picture layer in the 4th activate
// and the next commit will have a pending and active twin again.
- EXPECT_TRUE(activates_ == 1 || activates_ == 4);
+ EXPECT_TRUE(activates_ == 1 || activates_ == 4) << activates_;
EXPECT_EQ(pending_picture_impl,
active_picture_impl->GetPendingOrActiveTwinLayer());
@@ -114,13 +128,9 @@ class LayerTreeHostPictureTestTwinLayer
}
++activates_;
- if (activates_ <= 4)
- PostSetNeedsCommitToMainThread();
- else
- EndTest();
}
- void AfterTest() override {}
+ void AfterTest() override { EXPECT_EQ(5, activates_); }
int activates_;
};
« no previous file with comments | « cc/trees/layer_tree_host_unittest_damage.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698