| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input/scroll_state.h" | 5 #include "cc/input/scroll_state.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer_impl.h" | 7 #include "cc/layers/layer_impl.h" |
| 8 #include "cc/test/fake_impl_task_runner_provider.h" | 8 #include "cc/test/fake_impl_task_runner_provider.h" |
| 9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
| 10 #include "cc/test/test_shared_bitmap_manager.h" | 10 #include "cc/test/test_shared_bitmap_manager.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 FakeImplTaskRunnerProvider task_runner_provider; | 60 FakeImplTaskRunnerProvider task_runner_provider; |
| 61 TestSharedBitmapManager shared_bitmap_manager; | 61 TestSharedBitmapManager shared_bitmap_manager; |
| 62 TestTaskGraphRunner task_graph_runner; | 62 TestTaskGraphRunner task_graph_runner; |
| 63 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, | 63 FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager, |
| 64 &task_graph_runner); | 64 &task_graph_runner); |
| 65 | 65 |
| 66 scoped_ptr<LayerImpl> layer_impl = | 66 scoped_ptr<LayerImpl> layer_impl = |
| 67 LayerImpl::Create(host_impl.active_tree(), 1); | 67 LayerImpl::Create(host_impl.active_tree(), 1); |
| 68 scrollState.set_current_native_scrolling_layer(layer_impl.get()); | 68 scrollState.set_current_native_scrolling_layer(layer_impl.get()); |
| 69 EXPECT_EQ(layer_impl, scrollState.current_native_scrolling_layer()); | 69 EXPECT_EQ(layer_impl.get(), scrollState.current_native_scrolling_layer()); |
| 70 } | 70 } |
| 71 | 71 |
| 72 TEST_F(ScrollStateTest, FullyConsumed) { | 72 TEST_F(ScrollStateTest, FullyConsumed) { |
| 73 ScrollState scrollState(1, 3, 0, 0, 0, false, false); | 73 ScrollState scrollState(1, 3, 0, 0, 0, false, false); |
| 74 EXPECT_FALSE(scrollState.FullyConsumed()); | 74 EXPECT_FALSE(scrollState.FullyConsumed()); |
| 75 | 75 |
| 76 scrollState.ConsumeDelta(1, 3); | 76 scrollState.ConsumeDelta(1, 3); |
| 77 EXPECT_TRUE(scrollState.FullyConsumed()); | 77 EXPECT_TRUE(scrollState.FullyConsumed()); |
| 78 } | 78 } |
| 79 } // namespace cc | 79 } // namespace cc |
| OLD | NEW |