| Index: cc/trees/layer_tree_host_unittest_damage.cc
|
| diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
|
| index 7f008b46808a1370f53501e1d179b73e22bdf25c..846d5df0b02f45402d665f5540f275573387d1c0 100644
|
| --- a/cc/trees/layer_tree_host_unittest_damage.cc
|
| +++ b/cc/trees/layer_tree_host_unittest_damage.cc
|
| @@ -428,17 +428,23 @@ class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest {
|
| root_layer->SetMasksToBounds(true);
|
| layer_tree_host()->SetRootLayer(root_layer);
|
|
|
| + scoped_refptr<Layer> scroll_clip_layer = Layer::Create();
|
| scoped_refptr<Layer> content_layer = FakeContentLayer::Create(&client_);
|
| - content_layer->SetScrollable(true);
|
| + content_layer->SetScrollClipLayer(scroll_clip_layer.get());
|
| content_layer->SetScrollOffset(gfx::Vector2d(10, 20));
|
| - content_layer->SetMaxScrollOffset(gfx::Vector2d(30, 50));
|
| content_layer->SetBounds(gfx::Size(100, 200));
|
| - root_layer->AddChild(content_layer);
|
| + scroll_clip_layer->SetBounds(
|
| + gfx::Size(content_layer->bounds().width() - 30,
|
| + content_layer->bounds().height() - 50));
|
| + scroll_clip_layer->AddChild(content_layer);
|
| + root_layer->AddChild(scroll_clip_layer);
|
|
|
| scoped_refptr<Layer> scrollbar_layer =
|
| - FakePaintedScrollbarLayer::Create(false, true, content_layer->id());
|
| + FakePaintedScrollbarLayer::Create(false, true, content_layer.get());
|
| scrollbar_layer->SetPosition(gfx::Point(300, 300));
|
| scrollbar_layer->SetBounds(gfx::Size(10, 100));
|
| + scrollbar_layer->ToScrollbarLayer()->SetClipLayer(scroll_clip_layer);
|
| + scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer);
|
| root_layer->AddChild(scrollbar_layer);
|
|
|
| gfx::RectF content_rect(content_layer->position(),
|
| @@ -496,7 +502,8 @@ class LayerTreeHostDamageTestScrollbarDoesDamage
|
| ++did_swaps_;
|
| EXPECT_TRUE(result);
|
| LayerImpl* root = host_impl->active_tree()->root_layer();
|
| - LayerImpl* scroll_layer = root->children()[0];
|
| + LayerImpl* scroll_clip_layer = root->children()[0];
|
| + LayerImpl* scroll_layer = scroll_clip_layer->children()[0];
|
| switch (did_swaps_) {
|
| case 1:
|
| // Test that modifying the position of the content layer (not
|
| @@ -510,7 +517,8 @@ class LayerTreeHostDamageTestScrollbarDoesDamage
|
| host_impl->SetNeedsRedraw();
|
| break;
|
| case 3:
|
| - scroll_layer->SetMaxScrollOffset(gfx::Vector2d(60, 100));
|
| + scroll_layer->SetBounds(gfx::Size(root->bounds().width() + 60,
|
| + root->bounds().height() + 100));
|
| host_impl->SetNeedsRedraw();
|
| break;
|
| }
|
| @@ -569,7 +577,8 @@ class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage
|
| ++did_swaps_;
|
| EXPECT_TRUE(result);
|
| LayerImpl* root = host_impl->active_tree()->root_layer();
|
| - LayerImpl* scroll_layer = root->children()[0];
|
| + LayerImpl* scroll_clip_layer = root->children()[0];
|
| + LayerImpl* scroll_layer = scroll_clip_layer->children()[0];
|
| switch (did_swaps_) {
|
| case 1:
|
| // Scroll on the thread. This should damage the scrollbar for the
|
|
|