OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/views/controls/scroll_view.h" | 5 #include "ui/views/controls/scroll_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
8 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
9 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 13 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
13 #include "ui/events/test/event_generator.h" | 14 #include "ui/events/test/event_generator.h" |
14 #include "ui/views/border.h" | 15 #include "ui/views/border.h" |
15 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" | 16 #include "ui/views/controls/scrollbar/base_scroll_bar_thumb.h" |
16 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" | 17 #include "ui/views/controls/scrollbar/overlay_scroll_bar.h" |
17 #include "ui/views/controls/scrollbar/scroll_bar_views.h" | 18 #include "ui/views/controls/scrollbar/scroll_bar_views.h" |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 // Scroll via ScrollView API. Should be reflected on the impl side. | 1032 // Scroll via ScrollView API. Should be reflected on the impl side. |
1032 offset.set_y(kDefaultHeight * 4); | 1033 offset.set_y(kDefaultHeight * 4); |
1033 scroll_view->contents()->ScrollRectToVisible(offset); | 1034 scroll_view->contents()->ScrollRectToVisible(offset); |
1034 EXPECT_EQ(gfx::ScrollOffset(0, offset.y()), test_api.CurrentOffset()); | 1035 EXPECT_EQ(gfx::ScrollOffset(0, offset.y()), test_api.CurrentOffset()); |
1035 | 1036 |
1036 EXPECT_TRUE(compositor->GetScrollOffsetForLayer(layer_id, &impl_offset)); | 1037 EXPECT_TRUE(compositor->GetScrollOffsetForLayer(layer_id, &impl_offset)); |
1037 EXPECT_EQ(gfx::ScrollOffset(0, offset.y()), impl_offset); | 1038 EXPECT_EQ(gfx::ScrollOffset(0, offset.y()), impl_offset); |
1038 } | 1039 } |
1039 | 1040 |
1040 } // namespace views | 1041 } // namespace views |
OLD | NEW |