| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 gfx::Point scroll_point = | 687 gfx::Point scroll_point = |
| 688 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() - | 688 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() - |
| 689 gfx::Vector2dF(0.5f, 0.5f)); | 689 gfx::Vector2dF(0.5f, 0.5f)); |
| 690 InputHandler::ScrollStatus status = impl->ScrollBegin( | 690 InputHandler::ScrollStatus status = impl->ScrollBegin( |
| 691 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN); | 691 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN); |
| 692 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); | 692 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); |
| 693 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get()); | 693 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get()); |
| 694 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer(); | 694 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer(); |
| 695 CHECK(scrolling_layer); | 695 CHECK(scrolling_layer); |
| 696 impl->ScrollEnd(EndState().get()); | 696 impl->ScrollEnd(EndState().get()); |
| 697 impl->ClearCurrentlyScrollingLayerForTesting(); | |
| 698 CHECK(!impl->CurrentlyScrollingLayer()); | 697 CHECK(!impl->CurrentlyScrollingLayer()); |
| 699 EXPECT_EQ(scrolling_layer->id(), | 698 EXPECT_EQ(scrolling_layer->id(), |
| 700 impl->active_tree()->LastScrolledLayerId()); | 699 impl->active_tree()->LastScrolledLayerId()); |
| 701 | 700 |
| 702 // Check the scroll is applied as a delta. | 701 // Check the scroll is applied as a delta. |
| 703 EXPECT_VECTOR_EQ(initial_offset_, | 702 EXPECT_VECTOR_EQ(initial_offset_, |
| 704 ScrollTreeForLayer(expected_scroll_layer_impl) | 703 ScrollTreeForLayer(expected_scroll_layer_impl) |
| 705 ->GetScrollOffsetBaseForTesting( | 704 ->GetScrollOffsetBaseForTesting( |
| 706 expected_scroll_layer_impl->id())); | 705 expected_scroll_layer_impl->id())); |
| 707 EXPECT_VECTOR_EQ(scroll_amount_, | 706 EXPECT_VECTOR_EQ(scroll_amount_, |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 private: | 2040 private: |
| 2042 gfx::ScrollOffset initial_scroll_; | 2041 gfx::ScrollOffset initial_scroll_; |
| 2043 gfx::ScrollOffset second_scroll_; | 2042 gfx::ScrollOffset second_scroll_; |
| 2044 gfx::Vector2dF scroll_amount_; | 2043 gfx::Vector2dF scroll_amount_; |
| 2045 }; | 2044 }; |
| 2046 | 2045 |
| 2047 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); | 2046 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); |
| 2048 | 2047 |
| 2049 } // namespace | 2048 } // namespace |
| 2050 } // namespace cc | 2049 } // namespace cc |
| OLD | NEW |