OLD | NEW |
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" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 using namespace cc; | 13 namespace cc { |
14 | |
15 namespace { | 14 namespace { |
16 | 15 |
17 class ScrollbarAnimationControllerLinearFadeTest : public testing::Test { | 16 class ScrollbarAnimationControllerLinearFadeTest : public testing::Test { |
18 protected: | 17 protected: |
19 virtual void SetUp() | 18 virtual void SetUp() |
20 { | 19 { |
21 m_scrollLayer = LayerImpl::create(1); | 20 m_scrollLayer = LayerImpl::create(1); |
22 m_scrollLayer->addChild(LayerImpl::create(2)); | 21 m_scrollLayer->addChild(LayerImpl::create(2)); |
23 m_contentLayer = m_scrollLayer->children()[0]; | 22 m_contentLayer = m_scrollLayer->children()[0]; |
24 m_scrollbarLayer = ScrollbarLayerImpl::create(3); | 23 m_scrollbarLayer = ScrollbarLayerImpl::create(3); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity()); | 106 EXPECT_FLOAT_EQ(1, m_scrollbarLayer->opacity()); |
108 m_scrollbarController->animate(9); | 107 m_scrollbarController->animate(9); |
109 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity()); | 108 EXPECT_FLOAT_EQ(2 / 3.0f, m_scrollbarLayer->opacity()); |
110 m_scrollbarController->animate(10); | 109 m_scrollbarController->animate(10); |
111 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity()); | 110 EXPECT_FLOAT_EQ(1 / 3.0f, m_scrollbarLayer->opacity()); |
112 m_scrollbarController->animate(11); | 111 m_scrollbarController->animate(11); |
113 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); | 112 EXPECT_FLOAT_EQ(0, m_scrollbarLayer->opacity()); |
114 | 113 |
115 } | 114 } |
116 | 115 |
117 } // annoymous namespace | 116 } // namespace |
| 117 } // namespace cc |
OLD | NEW |