Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: ui/views/controls/scrollbar/scrollbar_unittest.cc

Issue 2189583004: [not for review - epic CL] Adding Elastic+Momentum+Layered scrolling to views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/controls/scrollbar/scroll_bar.h ('k') | ui/views/examples/scroll_view_example.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "ui/views/controls/scrollbar/native_scroll_bar.h" 6 #include "ui/views/controls/scrollbar/native_scroll_bar.h"
7 #include "ui/views/controls/scrollbar/native_scroll_bar_views.h" 7 #include "ui/views/controls/scrollbar/native_scroll_bar_views.h"
8 #include "ui/views/controls/scrollbar/scroll_bar.h" 8 #include "ui/views/controls/scrollbar/scroll_bar.h"
9 #include "ui/views/test/views_test_base.h" 9 #include "ui/views/test/views_test_base.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 16 matching lines...) Expand all
27 bool is_positive) override { 27 bool is_positive) override {
28 last_source = source; 28 last_source = source;
29 last_is_page = is_page; 29 last_is_page = is_page;
30 last_is_positive = is_positive; 30 last_is_positive = is_positive;
31 31
32 if (is_page) 32 if (is_page)
33 return 20; 33 return 20;
34 return 10; 34 return 10;
35 } 35 }
36 36
37 void OnScrollEventFromScrollBar(ui::ScrollEvent* event) override {}
38
37 // We save the last values in order to assert the correctness of the scroll 39 // We save the last values in order to assert the correctness of the scroll
38 // operation. 40 // operation.
39 views::ScrollBar* last_source; 41 views::ScrollBar* last_source;
40 bool last_is_positive; 42 bool last_is_positive;
41 bool last_is_page; 43 bool last_is_page;
42 int last_position; 44 int last_position;
43 }; 45 };
44 46
45 } // namespace 47 } // namespace
46 48
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 scrollbar_->GetThumbSizeForTest()); 195 scrollbar_->GetThumbSizeForTest());
194 // Emulate a click on the full size scroll bar. 196 // Emulate a click on the full size scroll bar.
195 scrollbar_->ScrollToThumbPosition(0, false); 197 scrollbar_->ScrollToThumbPosition(0, false);
196 EXPECT_EQ(0, scrollbar_->GetPosition()); 198 EXPECT_EQ(0, scrollbar_->GetPosition());
197 // Emulate a key down. 199 // Emulate a key down.
198 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_LINE); 200 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_LINE);
199 EXPECT_EQ(0, scrollbar_->GetPosition()); 201 EXPECT_EQ(0, scrollbar_->GetPosition());
200 } 202 }
201 203
202 } // namespace views 204 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/scroll_bar.h ('k') | ui/views/examples/scroll_view_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698