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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1061993009: cc: Make SingleThreadProxy ignore commit requests inside Layout(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stp-snc: fixtest Created 5 years, 8 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 | « no previous file | cc/trees/single_thread_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.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 7843fb45ae98c400d9ce51ac8f14e5a319aaba70..be879af1384d097e5b7d9ef53ec4ea1603c10248 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -86,6 +86,46 @@ class LayerTreeHostTest : public LayerTreeTest {
PrioritizedResourceManager* contents_texture_manager_;
};
+class LayerTreeHostTestSetNeedsCommitInsideLayout : public LayerTreeHostTest {
+ protected:
+ void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+
+ void Layout() override {
+ // This shouldn't cause a second commit to happen.
+ layer_tree_host()->SetNeedsCommit();
+ }
+
+ void DidCommit() override {
+ EXPECT_EQ(1, layer_tree_host()->source_frame_number());
+ EndTest();
+ }
+
+ void AfterTest() override {}
+};
+
+SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
+ LayerTreeHostTestSetNeedsCommitInsideLayout);
+
+class LayerTreeHostTestSetNeedsUpdateInsideLayout : public LayerTreeHostTest {
+ protected:
+ void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+
+ void Layout() override {
+ // This shouldn't cause a second commit to happen.
+ layer_tree_host()->SetNeedsUpdateLayers();
+ }
+
+ void DidCommit() override {
+ EXPECT_EQ(1, layer_tree_host()->source_frame_number());
+ EndTest();
+ }
+
+ void AfterTest() override {}
+};
+
+SINGLE_AND_MULTI_THREAD_IMPL_TEST_F(
+ LayerTreeHostTestSetNeedsUpdateInsideLayout);
+
// Test if the LTHI receives ReadyToActivate notifications from the TileManager
// when no raster tasks get scheduled.
class LayerTreeHostTestReadyToActivateEmpty : public LayerTreeHostTest {
« no previous file with comments | « no previous file | cc/trees/single_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698