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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2623313003: Add map from element id to scroll node index. (Closed)
Patch Set: Created 3 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
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 820562a3d484c8d90cb382d339a93b329ff91448..d274ba19ac1419c44d43a92bb179907f2fced659 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -57,6 +57,7 @@
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/layer_tree_impl.h"
+#include "cc/trees/scroll_node.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/swap_promise_manager.h"
#include "cc/trees/transform_node.h"
@@ -934,9 +935,13 @@ class LayerTreeHostTestPushElementIdToNodeIdMap : public LayerTreeHostTest {
switch (layer_tree_host()->SourceFrameNumber()) {
case 1:
child_->SetForceRenderSurfaceForTesting(true);
+ child_->AddMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
break;
case 2:
child_->SetForceRenderSurfaceForTesting(false);
+ child_->ClearMainThreadScrollingReasons(
+ MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
break;
}
}
@@ -952,12 +957,18 @@ class LayerTreeHostTestPushElementIdToNodeIdMap : public LayerTreeHostTest {
EXPECT_EQ(2U, child_impl_->layer_tree_impl()
->property_trees()
->effect_tree.size());
+ EXPECT_EQ(2U, child_impl_->layer_tree_impl()
+ ->property_trees()
+ ->scroll_tree.size());
EXPECT_TRUE(property_trees->element_id_to_transform_node_index.find(
kTestElementId) ==
property_trees->element_id_to_transform_node_index.end());
EXPECT_TRUE(property_trees->element_id_to_effect_node_index.find(
kTestElementId) ==
property_trees->element_id_to_effect_node_index.end());
+ EXPECT_TRUE(property_trees->element_id_to_scroll_node_index.find(
+ kTestElementId) ==
+ property_trees->element_id_to_scroll_node_index.end());
break;
case 1:
EXPECT_EQ(3U, child_impl_->layer_tree_impl()
@@ -966,11 +977,16 @@ class LayerTreeHostTestPushElementIdToNodeIdMap : public LayerTreeHostTest {
EXPECT_EQ(3U, child_impl_->layer_tree_impl()
->property_trees()
->effect_tree.size());
+ EXPECT_EQ(3U, child_impl_->layer_tree_impl()
+ ->property_trees()
+ ->scroll_tree.size());
EXPECT_EQ(
2,
property_trees->element_id_to_transform_node_index[kTestElementId]);
EXPECT_EQ(
2, property_trees->element_id_to_effect_node_index[kTestElementId]);
+ EXPECT_EQ(
+ 2, property_trees->element_id_to_scroll_node_index[kTestElementId]);
break;
case 2:
EXPECT_EQ(2U, child_impl_->layer_tree_impl()
@@ -985,6 +1001,9 @@ class LayerTreeHostTestPushElementIdToNodeIdMap : public LayerTreeHostTest {
EXPECT_TRUE(property_trees->element_id_to_effect_node_index.find(
kTestElementId) ==
property_trees->element_id_to_effect_node_index.end());
+ EXPECT_TRUE(property_trees->element_id_to_scroll_node_index.find(
+ kTestElementId) ==
+ property_trees->element_id_to_scroll_node_index.end());
break;
}
EndTest();

Powered by Google App Engine
This is Rietveld 408576698