OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/views/test/views_test_base.h" | 5 #include "ui/views/test/views_test_base.h" |
| 6 #include "ui/views/widget/widget.h" |
6 #include "views/controls/scrollbar/native_scroll_bar.h" | 7 #include "views/controls/scrollbar/native_scroll_bar.h" |
7 #include "views/controls/scrollbar/native_scroll_bar_views.h" | 8 #include "views/controls/scrollbar/native_scroll_bar_views.h" |
8 #include "views/controls/scrollbar/scroll_bar.h" | 9 #include "views/controls/scrollbar/scroll_bar.h" |
9 #include "views/widget/widget.h" | |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 // The Scrollbar controller. This is the widget that should do the real | 13 // The Scrollbar controller. This is the widget that should do the real |
14 // scrolling of contents. | 14 // scrolling of contents. |
15 class TestScrollBarController : public views::ScrollBarController { | 15 class TestScrollBarController : public views::ScrollBarController { |
16 public: | 16 public: |
17 virtual ~TestScrollBarController() {} | 17 virtual ~TestScrollBarController() {} |
18 | 18 |
19 virtual void ScrollToPosition(views::ScrollBar* source, | 19 virtual void ScrollToPosition(views::ScrollBar* source, |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 EXPECT_EQ(controller_->last_position, 0); | 140 EXPECT_EQ(controller_->last_position, 0); |
141 | 141 |
142 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_PAGE); | 142 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_PAGE); |
143 EXPECT_EQ(controller_->last_position, 20); | 143 EXPECT_EQ(controller_->last_position, 20); |
144 | 144 |
145 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_PREV_PAGE); | 145 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_PREV_PAGE); |
146 EXPECT_EQ(controller_->last_position, 0); | 146 EXPECT_EQ(controller_->last_position, 0); |
147 } | 147 } |
148 | 148 |
149 } // namespace views | 149 } // namespace views |
OLD | NEW |