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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
11 #include "cc/test/fake_content_layer_client.h" | 11 #include "cc/test/fake_content_layer_client.h" |
12 #include "cc/test/fake_layer_tree_host_client.h" | 12 #include "cc/test/fake_layer_tree_host_client.h" |
13 #include "cc/test/geometry_test_utils.h" | 13 #include "cc/test/geometry_test_utils.h" |
14 #include "cc/test/layer_tree_test.h" | 14 #include "cc/test/layer_tree_test.h" |
15 #include "cc/trees/layer_tree_impl.h" | 15 #include "cc/trees/layer_tree_impl.h" |
16 #include "ui/gfx/point_conversions.h" | 16 #include "ui/gfx/point_conversions.h" |
17 #include "ui/gfx/size_conversions.h" | 17 #include "ui/gfx/size_conversions.h" |
18 #include "ui/gfx/vector2d_conversions.h" | 18 #include "ui/gfx/vector2d_conversions.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 namespace { | 21 namespace { |
22 | 22 |
23 class LayerTreeHostScrollTest : public LayerTreeTest {}; | 23 class LayerTreeHostScrollTest : public LayerTreeTest { |
| 24 protected: |
| 25 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 26 settings->max_bytes_pending_upload = 16 * 1024 * 1024; |
| 27 } |
| 28 }; |
24 | 29 |
25 class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { | 30 class LayerTreeHostScrollTestScrollSimple : public LayerTreeHostScrollTest { |
26 public: | 31 public: |
27 LayerTreeHostScrollTestScrollSimple() | 32 LayerTreeHostScrollTestScrollSimple() |
28 : initial_scroll_(10, 20), | 33 : initial_scroll_(10, 20), |
29 second_scroll_(40, 5), | 34 second_scroll_(40, 5), |
30 scroll_amount_(2, -1), | 35 scroll_amount_(2, -1), |
31 num_scrolls_(0) {} | 36 num_scrolls_(0) {} |
32 | 37 |
33 virtual void BeginTest() OVERRIDE { | 38 virtual void BeginTest() OVERRIDE { |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 DeviceScaleFactor2_ScrollRootScrollLayer_DelegatingRenderer) { | 705 DeviceScaleFactor2_ScrollRootScrollLayer_DelegatingRenderer) { |
701 device_scale_factor_ = 2.f; | 706 device_scale_factor_ = 2.f; |
702 scroll_child_layer_ = false; | 707 scroll_child_layer_ = false; |
703 RunTest(true, true, true); | 708 RunTest(true, true, true); |
704 } | 709 } |
705 | 710 |
706 class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest { | 711 class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest { |
707 public: | 712 public: |
708 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 713 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
709 settings->impl_side_painting = true; | 714 settings->impl_side_painting = true; |
| 715 settings->max_bytes_pending_upload = 16 * 1024 * 1024; |
710 } | 716 } |
711 | 717 |
712 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 718 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
713 if (impl->pending_tree()) | 719 if (impl->pending_tree()) |
714 impl->SetNeedsRedraw(); | 720 impl->SetNeedsRedraw(); |
715 } | 721 } |
716 }; | 722 }; |
717 | 723 |
718 class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { | 724 class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { |
719 public: | 725 public: |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 RunTest(true, false, false); | 1133 RunTest(true, false, false); |
1128 } | 1134 } |
1129 | 1135 |
1130 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { | 1136 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { |
1131 scroll_destroy_whole_tree_ = true; | 1137 scroll_destroy_whole_tree_ = true; |
1132 RunTest(true, false, false); | 1138 RunTest(true, false, false); |
1133 } | 1139 } |
1134 | 1140 |
1135 } // namespace | 1141 } // namespace |
1136 } // namespace cc | 1142 } // namespace cc |
OLD | NEW |