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/layer.h" | 8 #include "cc/layers/layer.h" |
9 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 scroll_layer->SetScrollClipLayer(root->id()); | 1048 scroll_layer->SetScrollClipLayer(root->id()); |
1049 | 1049 |
1050 // Set max_scroll_offset = (100, 100). | 1050 // Set max_scroll_offset = (100, 100). |
1051 scroll_layer->SetBounds( | 1051 scroll_layer->SetBounds( |
1052 gfx::Size(root->bounds().width() + 100, root->bounds().height() + 100)); | 1052 gfx::Size(root->bounds().width() + 100, root->bounds().height() + 100)); |
1053 EXPECT_EQ(InputHandler::ScrollStarted, | 1053 EXPECT_EQ(InputHandler::ScrollStarted, |
1054 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), | 1054 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), |
1055 InputHandler::Gesture)); | 1055 InputHandler::Gesture)); |
1056 | 1056 |
1057 // Set max_scroll_offset = (0, 0). | 1057 // Set max_scroll_offset = (0, 0). |
1058 scroll_layer->SetBounds(gfx::ToCeiledSize(root->bounds())); | 1058 scroll_layer->SetBounds(root->bounds()); |
1059 EXPECT_EQ(InputHandler::ScrollIgnored, | 1059 EXPECT_EQ(InputHandler::ScrollIgnored, |
1060 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), | 1060 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), |
1061 InputHandler::Gesture)); | 1061 InputHandler::Gesture)); |
1062 | 1062 |
1063 // Set max_scroll_offset = (-100, -100). | 1063 // Set max_scroll_offset = (-100, -100). |
1064 scroll_layer->SetBounds(gfx::Size()); | 1064 scroll_layer->SetBounds(gfx::Size()); |
1065 EXPECT_EQ(InputHandler::ScrollIgnored, | 1065 EXPECT_EQ(InputHandler::ScrollIgnored, |
1066 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), | 1066 scroll_layer->TryScroll(gfx::PointF(0.0f, 1.0f), |
1067 InputHandler::Gesture)); | 1067 InputHandler::Gesture)); |
1068 | 1068 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 RunTest(true, false, true); | 1238 RunTest(true, false, true); |
1239 } | 1239 } |
1240 | 1240 |
1241 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { | 1241 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { |
1242 scroll_destroy_whole_tree_ = true; | 1242 scroll_destroy_whole_tree_ = true; |
1243 RunTest(true, false, true); | 1243 RunTest(true, false, true); |
1244 } | 1244 } |
1245 | 1245 |
1246 } // namespace | 1246 } // namespace |
1247 } // namespace cc | 1247 } // namespace cc |
OLD | NEW |