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

Unified Diff: cc/layers/scrollbar_layer_unittest.cc

Issue 2877033002: Fix cc scrollbar layer issues with initialization, and use element ids throughout. (Closed)
Patch Set: none Created 3 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/scrollbar_layer_impl_base.cc ('k') | cc/layers/solid_color_scrollbar_layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_unittest.cc
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index f490e41bab9575a1330d56084b70a46a0043bb3b..b5cc2b594b9c2df665bc5b455c985c89819e9df2 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -643,16 +643,19 @@ TEST_F(ScrollbarLayerTest, ScrollbarLayerOpacity) {
scoped_refptr<Layer> layer_tree_root = Layer::Create();
scoped_refptr<Layer> scroll_layer = Layer::Create();
scroll_layer->SetScrollClipLayerId(layer_tree_root->id());
+ scroll_layer->SetElementId(ElementId(200));
scoped_refptr<Layer> child1 = Layer::Create();
- scoped_refptr<Layer> scrollbar_layer;
+ scoped_refptr<SolidColorScrollbarLayer> scrollbar_layer;
const bool kIsLeftSideVerticalScrollbar = false;
scrollbar_layer = SolidColorScrollbarLayer::Create(
scrollbar->Orientation(), kThumbThickness, kTrackStart,
kIsLeftSideVerticalScrollbar, scroll_layer->element_id());
+ scrollbar_layer->SetElementId(ElementId(300));
scroll_layer->AddChild(child1);
scroll_layer->InsertChild(scrollbar_layer, 1);
layer_tree_root->AddChild(scroll_layer);
layer_tree_host_->SetRootLayer(layer_tree_root);
+ scrollbar_layer->SetScrollElementId(scroll_layer->element_id());
// Choose layer bounds to give max_scroll_offset = (8, 8).
layer_tree_root->SetBounds(gfx::Size(2, 2));
@@ -661,14 +664,8 @@ TEST_F(ScrollbarLayerTest, ScrollbarLayerOpacity) {
// Building property trees twice shouldn't change the size of
// PropertyTrees::always_use_active_tree_opacity_effect_ids.
layer_tree_host_->BuildPropertyTreesForTesting();
- EXPECT_EQ(layer_tree_host_->property_trees()
- ->always_use_active_tree_opacity_effect_ids.size(),
- 1u);
layer_tree_host_->property_trees()->needs_rebuild = true;
layer_tree_host_->BuildPropertyTreesForTesting();
- EXPECT_EQ(layer_tree_host_->property_trees()
- ->always_use_active_tree_opacity_effect_ids.size(),
- 1u);
// A solid color scrollbar layer's opacity is initialized to 0 on main thread
layer_tree_host_->UpdateLayers();
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.cc ('k') | cc/layers/solid_color_scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698