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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2776473002: Build property trees for the HUD layer when using layer lists (Closed)
Patch Set: Address reviewer comments Created 3 years, 9 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.cc ('k') | no next file » | 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 176f7baec707f3f1955cef2cf3849956102a253f..a1ab8ad52d30eb8e5328ac76d7db60a3faee704a 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -19,6 +19,7 @@
#include "cc/animation/timing_function.h"
#include "cc/input/scroll_elasticity_helper.h"
#include "cc/layers/content_layer_client.h"
+#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/picture_layer.h"
@@ -7198,5 +7199,41 @@ class LayerTreeHostTestQueueImageDecodeNonLazy : public LayerTreeHostTest {
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestQueueImageDecodeNonLazy);
+class LayerTreeHostTestHudLayerWithLayerLists : public LayerTreeHostTest {
+ public:
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->initial_debug_state.show_paint_rects = true;
+ settings->use_layer_lists = true;
+ }
+
+ void SetupTree() override {
+ LayerTreeHostTest::SetupTree();
+
+ // Build the property trees for the root layer.
+ layer_tree_host()->BuildPropertyTreesForTesting();
+
+ // The HUD layer should not have been setup by the property tree building.
+ DCHECK_EQ(layer_tree_host()->hud_layer(), nullptr);
+ }
+
+ void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+
+ void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { EndTest(); }
+
+ void DidCommit() override {
+ auto* hud = layer_tree_host()->hud_layer();
+ DCHECK(hud);
+ auto* root_layer = layer_tree_host()->root_layer();
+ DCHECK_EQ(hud->transform_tree_index(), root_layer->transform_tree_index());
+ DCHECK_EQ(hud->clip_tree_index(), root_layer->clip_tree_index());
+ DCHECK_EQ(hud->effect_tree_index(), root_layer->effect_tree_index());
+ DCHECK_EQ(hud->scroll_tree_index(), root_layer->scroll_tree_index());
+ }
+
+ void AfterTest() override {}
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestHudLayerWithLayerLists);
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698