Index: cc/animation/scrollbar_animation_controller_thinning_unittest.cc |
diff --git a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc |
index 7bb507614ef733d5d72c21fd992897267425ef75..5df6ff0914a452caa4a074fb41264f7c0bed96c6 100644 |
--- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc |
+++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc |
@@ -19,6 +19,9 @@ class ScrollbarAnimationControllerThinningTest : public testing::Test { |
protected: |
virtual void SetUp() { |
scroll_layer_ = LayerImpl::Create(host_impl_.active_tree(), 1); |
+ clip_layer_ = LayerImpl::Create(host_impl_.active_tree(), 3); |
+ scroll_layer_->SetScrollable(clip_layer_->id()); |
+ |
const int kId = 2; |
const int kThumbThickness = 10; |
const bool kIsLeftSideVerticalScrollbar = false; |
@@ -26,19 +29,23 @@ class ScrollbarAnimationControllerThinningTest : public testing::Test { |
host_impl_.active_tree(), kId, HORIZONTAL, kThumbThickness, |
kIsLeftSideVerticalScrollbar); |
- scroll_layer_->SetMaxScrollOffset(gfx::Vector2d(50, 50)); |
+ clip_layer_->SetBounds(gfx::Size(100, 100)); // MaxScrollOffset = (50, 50). |
+ clip_layer_->AddScrollbar(scrollbar_layer_.get()); |
scroll_layer_->SetBounds(gfx::Size(50, 50)); |
- scroll_layer_->SetHorizontalScrollbarLayer(scrollbar_layer_.get()); |
+ scroll_layer_->AddScrollbar(scrollbar_layer_.get()); |
scrollbar_controller_ = ScrollbarAnimationControllerThinning::CreateForTest( |
scroll_layer_.get(), |
base::TimeDelta::FromSeconds(2), |
base::TimeDelta::FromSeconds(3)); |
+ |
+ clip_layer_->AddChild(scroll_layer_.Pass()); |
} |
FakeImplProxy proxy_; |
FakeLayerTreeHostImpl host_impl_; |
scoped_ptr<ScrollbarAnimationControllerThinning> scrollbar_controller_; |
+ scoped_ptr<LayerImpl> clip_layer_; |
scoped_ptr<LayerImpl> scroll_layer_; |
scoped_ptr<SolidColorScrollbarLayerImpl> scrollbar_layer_; |
}; |