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" |
11 #include "cc/test/test_task_graph_runner.h" | 11 #include "cc/test/test_task_graph_runner.h" |
12 #include "cc/trees/layer_tree_impl.h" | 12 #include "cc/trees/layer_tree_impl.h" |
| 13 #include "cc/trees/scroll_node.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 | 18 |
18 class ScrollStateTest : public testing::Test {}; | 19 class ScrollStateTest : public testing::Test {}; |
19 | 20 |
20 TEST_F(ScrollStateTest, ConsumeDeltaNative) { | 21 TEST_F(ScrollStateTest, ConsumeDeltaNative) { |
21 const float delta_x = 12.3f; | 22 const float delta_x = 12.3f; |
22 const float delta_y = 3.9f; | 23 const float delta_y = 3.9f; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 ScrollStateData scroll_state_data; | 81 ScrollStateData scroll_state_data; |
81 scroll_state_data.delta_x = 1; | 82 scroll_state_data.delta_x = 1; |
82 scroll_state_data.delta_y = 3; | 83 scroll_state_data.delta_y = 3; |
83 ScrollState scroll_state(scroll_state_data); | 84 ScrollState scroll_state(scroll_state_data); |
84 | 85 |
85 EXPECT_FALSE(scroll_state.FullyConsumed()); | 86 EXPECT_FALSE(scroll_state.FullyConsumed()); |
86 scroll_state.ConsumeDelta(1, 3); | 87 scroll_state.ConsumeDelta(1, 3); |
87 EXPECT_TRUE(scroll_state.FullyConsumed()); | 88 EXPECT_TRUE(scroll_state.FullyConsumed()); |
88 } | 89 } |
89 } // namespace cc | 90 } // namespace cc |
OLD | NEW |