OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 vertical_scrollbar.get()); | 744 vertical_scrollbar.get()); |
745 | 745 |
746 // Trying to scroll with a vertical scrollbar will succeed. | 746 // Trying to scroll with a vertical scrollbar will succeed. |
747 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( | 747 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( |
748 gfx::Point(), SCROLL_FORWARD)); | 748 gfx::Point(), SCROLL_FORWARD)); |
749 EXPECT_FLOAT_EQ(875.f, host_impl_->RootScrollLayer()->ScrollDelta().y()); | 749 EXPECT_FLOAT_EQ(875.f, host_impl_->RootScrollLayer()->ScrollDelta().y()); |
750 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( | 750 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( |
751 gfx::Point(), SCROLL_BACKWARD)); | 751 gfx::Point(), SCROLL_BACKWARD)); |
752 } | 752 } |
753 | 753 |
754 TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) { | 754 // The user-scrollability breaks for zoomed-in pages. So disable this. |
| 755 // http://crbug.com/322223 |
| 756 TEST_F(LayerTreeHostImplTest, DISABLED_ScrollWithUserUnscrollableLayers) { |
755 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(200, 200)); | 757 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(200, 200)); |
756 host_impl_->SetViewportSize(gfx::Size(100, 100)); | 758 host_impl_->SetViewportSize(gfx::Size(100, 100)); |
757 | 759 |
758 gfx::Size overflow_size(400, 400); | 760 gfx::Size overflow_size(400, 400); |
759 ASSERT_EQ(1u, scroll_layer->children().size()); | 761 ASSERT_EQ(1u, scroll_layer->children().size()); |
760 LayerImpl* overflow = scroll_layer->children()[0]; | 762 LayerImpl* overflow = scroll_layer->children()[0]; |
761 overflow->SetBounds(overflow_size); | 763 overflow->SetBounds(overflow_size); |
762 overflow->SetContentBounds(overflow_size); | 764 overflow->SetContentBounds(overflow_size); |
763 overflow->SetScrollable(true); | 765 overflow->SetScrollable(true); |
764 overflow->SetMaxScrollOffset(gfx::Vector2d(overflow_size.width(), | 766 overflow->SetMaxScrollOffset(gfx::Vector2d(overflow_size.width(), |
(...skipping 4694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5459 // The root should have scrolled. | 5461 // The root should have scrolled. |
5460 ASSERT_EQ(2u, scroll_info->scrolls.size()); | 5462 ASSERT_EQ(2u, scroll_info->scrolls.size()); |
5461 ExpectContains(*scroll_info.get(), | 5463 ExpectContains(*scroll_info.get(), |
5462 host_impl_->active_tree()->root_layer()->id(), | 5464 host_impl_->active_tree()->root_layer()->id(), |
5463 gfx::Vector2d(0, 10)); | 5465 gfx::Vector2d(0, 10)); |
5464 } | 5466 } |
5465 } | 5467 } |
5466 | 5468 |
5467 } // namespace | 5469 } // namespace |
5468 } // namespace cc | 5470 } // namespace cc |
OLD | NEW |