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

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

Issue 2197503002: Route Scroll events through a cc::InputHandler Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollWheelAsScrollEvent
Patch Set: Abandon DeliverInputForBeginFrame: will not help fix the header row Created 4 years 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') | no next file » | 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/scroll_bar.h" 6 #include "ui/views/controls/scrollbar/scroll_bar.h"
7 #include "ui/views/controls/scrollbar/scroll_bar_views.h" 7 #include "ui/views/controls/scrollbar/scroll_bar_views.h"
8 #include "ui/views/test/views_test_base.h" 8 #include "ui/views/test/views_test_base.h"
9 #include "ui/views/widget/widget.h" 9 #include "ui/views/widget/widget.h"
10 10
(...skipping 15 matching lines...) Expand all
26 bool is_positive) override { 26 bool is_positive) override {
27 last_source = source; 27 last_source = source;
28 last_is_page = is_page; 28 last_is_page = is_page;
29 last_is_positive = is_positive; 29 last_is_positive = is_positive;
30 30
31 if (is_page) 31 if (is_page)
32 return 20; 32 return 20;
33 return 10; 33 return 10;
34 } 34 }
35 35
36 void OnScrollEventFromScrollBar(ui::ScrollEvent* event) override {}
37
36 // We save the last values in order to assert the correctness of the scroll 38 // We save the last values in order to assert the correctness of the scroll
37 // operation. 39 // operation.
38 views::ScrollBar* last_source; 40 views::ScrollBar* last_source;
39 bool last_is_positive; 41 bool last_is_positive;
40 bool last_is_page; 42 bool last_is_page;
41 int last_position; 43 int last_position;
42 }; 44 };
43 45
44 } // namespace 46 } // namespace
45 47
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 scrollbar_->GetThumbSizeForTest()); 186 scrollbar_->GetThumbSizeForTest());
185 // Emulate a click on the full size scroll bar. 187 // Emulate a click on the full size scroll bar.
186 scrollbar_->ScrollToThumbPosition(0, false); 188 scrollbar_->ScrollToThumbPosition(0, false);
187 EXPECT_EQ(0, scrollbar_->GetPosition()); 189 EXPECT_EQ(0, scrollbar_->GetPosition());
188 // Emulate a key down. 190 // Emulate a key down.
189 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_LINE); 191 scrollbar_->ScrollByAmount(BaseScrollBar::SCROLL_NEXT_LINE);
190 EXPECT_EQ(0, scrollbar_->GetPosition()); 192 EXPECT_EQ(0, scrollbar_->GetPosition());
191 } 193 }
192 194
193 } // namespace views 195 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/scroll_bar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698