| 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_web_scrollbar_theme_geometry.h" | 10 #include "cc/test/fake_web_scrollbar_theme_geometry.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); | 115 EXPECT_EQ(1000, ccScrollbarLayer->totalSize()); |
| 116 EXPECT_EQ(300, ccScrollbarLayer->maximum()); | 116 EXPECT_EQ(300, ccScrollbarLayer->maximum()); |
| 117 | 117 |
| 118 layerImplTreeRoot->scrollBy(gfx::Vector2d(12, 34)); | 118 layerImplTreeRoot->scrollBy(gfx::Vector2d(12, 34)); |
| 119 | 119 |
| 120 EXPECT_EQ(112, ccScrollbarLayer->currentPos()); | 120 EXPECT_EQ(112, ccScrollbarLayer->currentPos()); |
| 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 | 124 |
| 125 class ScrollbarLayerTestMaxTextureSize : public WebKitTests::ThreadedTest { | 125 class ScrollbarLayerTestMaxTextureSize : public ThreadedTest { |
| 126 public: | 126 public: |
| 127 ScrollbarLayerTestMaxTextureSize() {} | 127 ScrollbarLayerTestMaxTextureSize() {} |
| 128 | 128 |
| 129 void setScrollbarBounds(gfx::Size bounds) { | 129 void setScrollbarBounds(gfx::Size bounds) { |
| 130 m_bounds = bounds; | 130 m_bounds = bounds; |
| 131 } | 131 } |
| 132 | 132 |
| 133 virtual void beginTest() OVERRIDE | 133 virtual void beginTest() OVERRIDE |
| 134 { | 134 { |
| 135 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create()); | 135 scoped_ptr<WebKit::WebScrollbar> scrollbar(FakeWebScrollbar::create()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 TEST_F(ScrollbarLayerTestMaxTextureSize, runTest) { | 173 TEST_F(ScrollbarLayerTestMaxTextureSize, runTest) { |
| 174 WebKit::FakeWebGraphicsContext3D context; | 174 WebKit::FakeWebGraphicsContext3D context; |
| 175 int max_size = 0; | 175 int max_size = 0; |
| 176 context.getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 176 context.getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 177 setScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 177 setScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 178 runTest(true); | 178 runTest(true); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace | 181 } // namespace |
| 182 } // namespace cc | 182 } // namespace cc |
| OLD | NEW |