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

Side by Side Diff: cc/scrollbar_animation_controller_linear_fade_unittest.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address code review comments and fix all cc_unittests Created 8 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/scrollbar_animation_controller_linear_fade.h" 7 #include "cc/scrollbar_animation_controller_linear_fade.h"
8 8
9 #include "cc/scrollbar_layer_impl.h" 9 #include "cc/scrollbar_layer_impl.h"
10 #include "cc/single_thread_proxy.h" 10 #include "cc/single_thread_proxy.h"
(...skipping 12 matching lines...) Expand all
23 m_contentLayer = m_scrollLayer->children()[0]; 23 m_contentLayer = m_scrollLayer->children()[0];
24 m_scrollbarLayer = ScrollbarLayerImpl::create(3); 24 m_scrollbarLayer = ScrollbarLayerImpl::create(3);
25 25
26 m_scrollLayer->setMaxScrollPosition(IntSize(50, 50)); 26 m_scrollLayer->setMaxScrollPosition(IntSize(50, 50));
27 m_contentLayer->setBounds(IntSize(50, 50)); 27 m_contentLayer->setBounds(IntSize(50, 50));
28 28
29 m_scrollbarController = ScrollbarAnimationControllerLinearFade::create(m _scrollLayer.get(), 2, 3); 29 m_scrollbarController = ScrollbarAnimationControllerLinearFade::create(m _scrollLayer.get(), 2, 3);
30 m_scrollbarController->setHorizontalScrollbarLayer(m_scrollbarLayer.get( )); 30 m_scrollbarController->setHorizontalScrollbarLayer(m_scrollbarLayer.get( ));
31 } 31 }
32 32
33 DebugScopedSetImplThread implThread;
34
35 scoped_ptr<ScrollbarAnimationControllerLinearFade> m_scrollbarController; 33 scoped_ptr<ScrollbarAnimationControllerLinearFade> m_scrollbarController;
36 scoped_ptr<LayerImpl> m_scrollLayer; 34 scoped_ptr<LayerImpl> m_scrollLayer;
37 LayerImpl* m_contentLayer; 35 LayerImpl* m_contentLayer;
38 scoped_ptr<ScrollbarLayerImpl> m_scrollbarLayer; 36 scoped_ptr<ScrollbarLayerImpl> m_scrollbarLayer;
39 37
40 }; 38 };
41 39
42 TEST_F(ScrollbarAnimationControllerLinearFadeTest, verifyHiddenInBegin) 40 TEST_F(ScrollbarAnimationControllerLinearFadeTest, verifyHiddenInBegin)
43 { 41 {
44 m_scrollbarController->animate(0); 42 m_scrollbarController->animate(0);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 m_scrollbarController->animate(9); 108 m_scrollbarController->animate(9);
111 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity()); 109 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
112 m_scrollbarController->animate(10); 110 m_scrollbarController->animate(10);
113 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity()); 111 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
114 m_scrollbarController->animate(11); 112 m_scrollbarController->animate(11);
115 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); 113 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
116 114
117 } 115 }
118 116
119 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698