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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 7116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7127 EXPECT_TRUE(did_request_commit_); | 7127 EXPECT_TRUE(did_request_commit_); |
7128 } | 7128 } |
7129 } | 7129 } |
7130 EXPECT_FALSE(host_impl_->top_controls_manager()->animation()); | 7130 EXPECT_FALSE(host_impl_->top_controls_manager()->animation()); |
7131 EXPECT_EQ(-top_controls_height_, | 7131 EXPECT_EQ(-top_controls_height_, |
7132 host_impl_->top_controls_manager()->ControlsTopOffset()); | 7132 host_impl_->top_controls_manager()->ControlsTopOffset()); |
7133 } | 7133 } |
7134 | 7134 |
7135 TEST_F(LayerTreeHostImplWithTopControlsTest, | 7135 TEST_F(LayerTreeHostImplWithTopControlsTest, |
7136 TopControlsScrollDeltaInOverScroll) { | 7136 TopControlsScrollDeltaInOverScroll) { |
7137 // test varifies that the overscroll delta should not have accumulated in | 7137 // Verifies that the overscroll delta should not have accumulated in |
7138 // the top controls if we do a hide and show without releasing finger. | 7138 // the top controls if we do a hide and show without releasing finger. |
7139 | 7139 |
7140 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 200)); | 7140 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(100, 200)); |
7141 host_impl_->SetViewportSize(gfx::Size(100, 100)); | 7141 host_impl_->SetViewportSize(gfx::Size(100, 100)); |
7142 host_impl_->top_controls_manager()->UpdateTopControlsState(BOTH, SHOWN, | 7142 host_impl_->top_controls_manager()->UpdateTopControlsState(BOTH, SHOWN, |
7143 false); | 7143 false); |
7144 DrawFrame(); | 7144 DrawFrame(); |
7145 | 7145 |
7146 EXPECT_EQ(InputHandler::SCROLL_STARTED, | 7146 EXPECT_EQ(InputHandler::SCROLL_STARTED, |
7147 host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE)); | 7147 host_impl_->ScrollBegin(gfx::Point(), InputHandler::GESTURE)); |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8003 // Hold an unowned pointer to the output surface to use for mock expectations. | 8003 // Hold an unowned pointer to the output surface to use for mock expectations. |
8004 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); | 8004 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); |
8005 | 8005 |
8006 CreateHostImpl(DefaultSettings(), output_surface.Pass()); | 8006 CreateHostImpl(DefaultSettings(), output_surface.Pass()); |
8007 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); | 8007 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); |
8008 host_impl_->BeginCommit(); | 8008 host_impl_->BeginCommit(); |
8009 } | 8009 } |
8010 | 8010 |
8011 } // namespace | 8011 } // namespace |
8012 } // namespace cc | 8012 } // namespace cc |
OLD | NEW |