| 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/layers/scrollbar_layer.h" | 5 #include "cc/layers/scrollbar_layer.h" |
| 6 | 6 |
| 7 #include "cc/animation/scrollbar_animation_controller.h" | 7 #include "cc/animation/scrollbar_animation_controller.h" |
| 8 #include "cc/layers/append_quads_data.h" | 8 #include "cc/layers/append_quads_data.h" |
| 9 #include "cc/layers/scrollbar_layer_impl.h" | 9 #include "cc/layers/scrollbar_layer_impl.h" |
| 10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 virtual void AfterTest() OVERRIDE {} | 323 virtual void AfterTest() OVERRIDE {} |
| 324 | 324 |
| 325 private: | 325 private: |
| 326 scoped_refptr<ScrollbarLayer> scrollbar_layer_; | 326 scoped_refptr<ScrollbarLayer> scrollbar_layer_; |
| 327 scoped_refptr<Layer> scroll_layer_; | 327 scoped_refptr<Layer> scroll_layer_; |
| 328 gfx::Size bounds_; | 328 gfx::Size bounds_; |
| 329 }; | 329 }; |
| 330 | 330 |
| 331 TEST_F(ScrollbarLayerTestMaxTextureSize, RunTest) { | 331 TEST_F(ScrollbarLayerTestMaxTextureSize, DirectRenderer) { |
| 332 scoped_ptr<TestWebGraphicsContext3D> context = | 332 scoped_ptr<TestWebGraphicsContext3D> context = |
| 333 TestWebGraphicsContext3D::Create(); | 333 TestWebGraphicsContext3D::Create(); |
| 334 int max_size = 0; | 334 int max_size = 0; |
| 335 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); | 335 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 336 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); | 336 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 337 RunTest(true); | 337 RunTest(true, false); |
| 338 } |
| 339 |
| 340 TEST_F(ScrollbarLayerTestMaxTextureSize, DelegatingRenderer) { |
| 341 scoped_ptr<TestWebGraphicsContext3D> context = |
| 342 TestWebGraphicsContext3D::Create(); |
| 343 int max_size = 0; |
| 344 context->getIntegerv(GL_MAX_TEXTURE_SIZE, &max_size); |
| 345 SetScrollbarBounds(gfx::Size(max_size + 100, max_size + 100)); |
| 346 RunTest(true, true); |
| 338 } | 347 } |
| 339 | 348 |
| 340 class MockLayerTreeHost : public LayerTreeHost { | 349 class MockLayerTreeHost : public LayerTreeHost { |
| 341 public: | 350 public: |
| 342 MockLayerTreeHost(LayerTreeHostClient* client, | 351 MockLayerTreeHost(LayerTreeHostClient* client, |
| 343 const LayerTreeSettings& settings) | 352 const LayerTreeSettings& settings) |
| 344 : LayerTreeHost(client, settings) { | 353 : LayerTreeHost(client, settings) { |
| 345 Initialize(scoped_ptr<Thread>(NULL)); | 354 Initialize(scoped_ptr<Thread>(NULL)); |
| 346 } | 355 } |
| 347 }; | 356 }; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 EXPECT_EQ(10.f, pinch_zoom_horizontal->CurrentPos()); | 489 EXPECT_EQ(10.f, pinch_zoom_horizontal->CurrentPos()); |
| 481 EXPECT_EQ(100, pinch_zoom_horizontal->TotalSize()); | 490 EXPECT_EQ(100, pinch_zoom_horizontal->TotalSize()); |
| 482 EXPECT_EQ(30, pinch_zoom_horizontal->Maximum()); | 491 EXPECT_EQ(30, pinch_zoom_horizontal->Maximum()); |
| 483 EXPECT_EQ(20.f, pinch_zoom_vertical->CurrentPos()); | 492 EXPECT_EQ(20.f, pinch_zoom_vertical->CurrentPos()); |
| 484 EXPECT_EQ(200, pinch_zoom_vertical->TotalSize()); | 493 EXPECT_EQ(200, pinch_zoom_vertical->TotalSize()); |
| 485 EXPECT_EQ(50, pinch_zoom_vertical->Maximum()); | 494 EXPECT_EQ(50, pinch_zoom_vertical->Maximum()); |
| 486 } | 495 } |
| 487 | 496 |
| 488 } // namespace | 497 } // namespace |
| 489 } // namespace cc | 498 } // namespace cc |
| OLD | NEW |