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

Unified Diff: cc/animation/scrollbar_animation_controller_linear_fade_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
Index: cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
index b4c1160b081bae8f1cc600f8c4335e0efed434fa..9fdb2e9c582dd481186bf4000c2ebf97c73192b2 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
@@ -4,7 +4,7 @@
#include "cc/animation/scrollbar_animation_controller_linear_fade.h"
-#include "cc/layers/painted_scrollbar_layer_impl.h"
+#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -18,16 +18,31 @@ class ScrollbarAnimationControllerLinearFadeTest : public testing::Test {
protected:
virtual void SetUp() {
- scroll_layer_ = LayerImpl::Create(host_impl_.active_tree(), 1);
- scrollbar_layer_ = PaintedScrollbarLayerImpl::Create(
- host_impl_.active_tree(), 2, HORIZONTAL);
-
- scroll_layer_->SetMaxScrollOffset(gfx::Vector2d(50, 50));
- scroll_layer_->SetBounds(gfx::Size(50, 50));
- scroll_layer_->SetHorizontalScrollbarLayer(scrollbar_layer_.get());
+ const int kThumbThickness = 10;
+ const bool kIsLeftSideVerticalScrollbar = false;
+ const bool kIsOverlayScrollbar = true; // Allow opacity animations.
+
+ scoped_ptr<LayerImpl> scroll_layer =
+ LayerImpl::Create(host_impl_.active_tree(), 1);
+ scrollbar_layer_ =
+ SolidColorScrollbarLayerImpl::Create(host_impl_.active_tree(),
+ 2,
+ HORIZONTAL,
+ kThumbThickness,
+ kIsLeftSideVerticalScrollbar,
+ kIsOverlayScrollbar);
+ 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());
+
+ 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_ = ScrollbarAnimationControllerLinearFade::Create(
- scroll_layer_.get(),
+ scroll_layer_ptr,
base::TimeDelta::FromSeconds(2),
base::TimeDelta::FromSeconds(3));
}
@@ -35,8 +50,8 @@ class ScrollbarAnimationControllerLinearFadeTest : public testing::Test {
FakeImplProxy proxy_;
FakeLayerTreeHostImpl host_impl_;
scoped_ptr<ScrollbarAnimationControllerLinearFade> scrollbar_controller_;
- scoped_ptr<LayerImpl> scroll_layer_;
- scoped_ptr<PaintedScrollbarLayerImpl> scrollbar_layer_;
+ scoped_ptr<LayerImpl> clip_layer_;
+ scoped_ptr<SolidColorScrollbarLayerImpl> scrollbar_layer_;
};
TEST_F(ScrollbarAnimationControllerLinearFadeTest, HiddenInBegin) {
« no previous file with comments | « cc/animation/scrollbar_animation_controller_linear_fade.cc ('k') | cc/animation/scrollbar_animation_controller_thinning.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698