| 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 "cc/scrollbar_layer.h" | 5 #include "cc/scrollbar_layer.h" |
| 6 | 6 |
| 7 #include "cc/scrollbar_animation_controller.h" | 7 #include "cc/scrollbar_animation_controller.h" |
| 8 #include "cc/scrollbar_layer_impl.h" | 8 #include "cc/scrollbar_layer_impl.h" |
| 9 #include "cc/single_thread_proxy.h" | 9 #include "cc/single_thread_proxy.h" |
| 10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); | 121 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); |
| 122 EXPECT_EQ(300, ccScrollbarLayer->maximum()); | 122 EXPECT_EQ(300, ccScrollbarLayer->maximum()); |
| 123 | 123 |
| 124 layerImplTreeRoot->scrollBy(gfx::Vector2d(12, 34)); | 124 layerImplTreeRoot->scrollBy(gfx::Vector2d(12, 34)); |
| 125 | 125 |
| 126 EXPECT_EQ(112, ccScrollbarLayer->currentPos()); | 126 EXPECT_EQ(112, ccScrollbarLayer->currentPos()); |
| 127 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); | 127 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); |
| 128 EXPECT_EQ(300, ccScrollbarLayer->maximum()); | 128 EXPECT_EQ(300, ccScrollbarLayer->maximum()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 class ScrollbarLayerTestMaxTextureSize : public WebKitTests::ThreadedTest { | 131 class ScrollbarLayerTestMaxTextureSize : public ThreadedTest { |
| 132 public: | 132 public: |
| 133 ScrollbarLayerTestMaxTextureSize() {} | 133 ScrollbarLayerTestMaxTextureSize() {} |
| 134 | 134 |
| 135 void setScrollbarBounds(gfx::Size bounds) { | 135 void setScrollbarBounds(gfx::Size bounds) { |
| 136 m_bounds = bounds; | 136 m_bounds = bounds; |
| 137 } | 137 } |
| 138 | 138 |
| 139 virtual void beginTest() OVERRIDE | 139 virtual void beginTest() OVERRIDE |
| 140 { | 140 { |
| 141 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create()); | 141 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 TEST_F(ScrollbarLayerTestMaxTextureSize, runTest) { | 179 TEST_F(ScrollbarLayerTestMaxTextureSize, runTest) { |
| 180 WebKit::FakeWebGraphicsContext3D context; | 180 WebKit::FakeWebGraphicsContext3D context; |
| 181 int max_size = 0; | 181 int max_size = 0; |
| 182 context.getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 182 context.getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 183 setScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 183 setScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 184 runTest(true); | 184 runTest(true); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace | 187 } // namespace |
| 188 } // namespace cc | 188 } // namespace cc |
| OLD | NEW |