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

Side by Side Diff: cc/CCScrollbarAnimationControllerLinearFadeTest.cpp

Issue 11099040: [cc] Store CCLayerImpls as scoped_ptrs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cc unit tests 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 | Annotate | Revision Log
« no previous file with comments | « cc/CCRendererGLTest.cpp ('k') | cc/CCScrollbarLayerImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "CCScrollbarAnimationControllerLinearFade.h" 7 #include "CCScrollbarAnimationControllerLinearFade.h"
8 8
9 #include "CCScrollbarLayerImpl.h" 9 #include "CCScrollbarLayerImpl.h"
10 #include "CCSingleThreadProxy.h" 10 #include "CCSingleThreadProxy.h"
(...skipping 16 matching lines...) Expand all
27 m_scrollLayer->setMaxScrollPosition(IntSize(50, 50)); 27 m_scrollLayer->setMaxScrollPosition(IntSize(50, 50));
28 m_contentLayer->setBounds(IntSize(50, 50)); 28 m_contentLayer->setBounds(IntSize(50, 50));
29 29
30 m_scrollbarController = CCScrollbarAnimationControllerLinearFade::create (m_scrollLayer.get(), 2, 3); 30 m_scrollbarController = CCScrollbarAnimationControllerLinearFade::create (m_scrollLayer.get(), 2, 3);
31 m_scrollbarController->setHorizontalScrollbarLayer(m_scrollbarLayer.get( )); 31 m_scrollbarController->setHorizontalScrollbarLayer(m_scrollbarLayer.get( ));
32 } 32 }
33 33
34 DebugScopedSetImplThread implThread; 34 DebugScopedSetImplThread implThread;
35 35
36 OwnPtr<CCScrollbarAnimationControllerLinearFade> m_scrollbarController; 36 OwnPtr<CCScrollbarAnimationControllerLinearFade> m_scrollbarController;
37 OwnPtr<CCLayerImpl> m_scrollLayer; 37 scoped_ptr<CCLayerImpl> m_scrollLayer;
38 CCLayerImpl* m_contentLayer; 38 CCLayerImpl* m_contentLayer;
39 OwnPtr<CCScrollbarLayerImpl> m_scrollbarLayer; 39 scoped_ptr<CCScrollbarLayerImpl> m_scrollbarLayer;
40 40
41 }; 41 };
42 42
43 TEST_F(CCScrollbarAnimationControllerLinearFadeTest, verifyHiddenInBegin) 43 TEST_F(CCScrollbarAnimationControllerLinearFadeTest, verifyHiddenInBegin)
44 { 44 {
45 m_scrollbarController->animate(0); 45 m_scrollbarController->animate(0);
46 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); 46 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
47 m_scrollbarController->updateScrollOffsetAtTime(m_scrollLayer.get(), 0); 47 m_scrollbarController->updateScrollOffsetAtTime(m_scrollLayer.get(), 0);
48 m_scrollbarController->animate(0); 48 m_scrollbarController->animate(0);
49 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); 49 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 m_scrollbarController->animate(9); 111 m_scrollbarController->animate(9);
112 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity()); 112 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity());
113 m_scrollbarController->animate(10); 113 m_scrollbarController->animate(10);
114 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity()); 114 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity());
115 m_scrollbarController->animate(11); 115 m_scrollbarController->animate(11);
116 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); 116 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity());
117 117
118 } 118 }
119 119
120 } 120 }
OLDNEW
« no previous file with comments | « cc/CCRendererGLTest.cpp ('k') | cc/CCScrollbarLayerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698