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

Unified Diff: cc/animation/scrollbar_animation_controller_thinning_unittest.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to r248052. Created 6 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
« no previous file with comments | « cc/animation/scrollbar_animation_controller_thinning.cc ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c915632f2fc8af1dd615662f0acf832f9c61a132..c50c9b469ac0d7bf464a9191f7a96321bdca06c5 100644
--- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
@@ -18,20 +18,32 @@ class ScrollbarAnimationControllerThinningTest : public testing::Test {
protected:
virtual void SetUp() {
- scroll_layer_ = LayerImpl::Create(host_impl_.active_tree(), 1);
+ scoped_ptr<LayerImpl> scroll_layer =
+ LayerImpl::Create(host_impl_.active_tree(), 1);
+ clip_layer_ = LayerImpl::Create(host_impl_.active_tree(), 3);
+ scroll_layer->SetScrollClipLayer(clip_layer_->id());
+ LayerImpl* scroll_layer_ptr = scroll_layer.get();
+ clip_layer_->AddChild(scroll_layer.Pass());
+
const int kId = 2;
const int kThumbThickness = 10;
const bool kIsLeftSideVerticalScrollbar = false;
- scrollbar_layer_ = SolidColorScrollbarLayerImpl::Create(
- host_impl_.active_tree(), kId, HORIZONTAL, kThumbThickness,
- kIsLeftSideVerticalScrollbar);
-
- scroll_layer_->SetMaxScrollOffset(gfx::Vector2d(50, 50));
- scroll_layer_->SetBounds(gfx::Size(50, 50));
- scroll_layer_->SetHorizontalScrollbarLayer(scrollbar_layer_.get());
+ const bool kIsOverlayScrollbar = true;
+ scrollbar_layer_ =
+ SolidColorScrollbarLayerImpl::Create(host_impl_.active_tree(),
+ kId,
+ HORIZONTAL,
+ kThumbThickness,
+ kIsLeftSideVerticalScrollbar,
+ kIsOverlayScrollbar);
+
+ scrollbar_layer_->SetClipLayerById(clip_layer_->id());
+ scrollbar_layer_->SetScrollLayerById(scroll_layer_ptr->id());
+ clip_layer_->SetBounds(gfx::Size(100, 100));
+ scroll_layer_ptr->SetBounds(gfx::Size(50, 50));
scrollbar_controller_ = ScrollbarAnimationControllerThinning::CreateForTest(
- scroll_layer_.get(),
+ scroll_layer_ptr,
base::TimeDelta::FromSeconds(2),
base::TimeDelta::FromSeconds(3));
}
@@ -39,7 +51,7 @@ class ScrollbarAnimationControllerThinningTest : public testing::Test {
FakeImplProxy proxy_;
FakeLayerTreeHostImpl host_impl_;
scoped_ptr<ScrollbarAnimationControllerThinning> scrollbar_controller_;
- scoped_ptr<LayerImpl> scroll_layer_;
+ scoped_ptr<LayerImpl> clip_layer_;
scoped_ptr<SolidColorScrollbarLayerImpl> scrollbar_layer_;
};
« no previous file with comments | « cc/animation/scrollbar_animation_controller_thinning.cc ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698