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

Side by Side Diff: ui/views/controls/slider_unittest.cc

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/slider.cc ('k') | ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc » ('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 "ui/views/controls/slider.h" 5 #include "ui/views/controls/slider.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/base/accessibility/accessible_view_state.h" 11 #include "ui/base/accessibility/accessible_view_state.h"
12 #include "ui/base/l10n/l10n_util.h" 12 #include "ui/base/l10n/l10n_util.h"
13 #include "ui/views/view.h" 13 #include "ui/views/view.h"
14 14
15 namespace { 15 namespace {
16 16
17 void ClickAt(views::View* view, int x, int y) { 17 void ClickAt(views::View* view, int x, int y) {
18 views::MouseEvent press(ui::ET_MOUSE_PRESSED, x, y, ui::EF_LEFT_MOUSE_BUTTON); 18 gfx::Point point(x, y);
19 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, point, point,
20 ui::EF_LEFT_MOUSE_BUTTON);
19 view->OnMousePressed(press); 21 view->OnMousePressed(press);
20 views::MouseEvent release(ui::ET_MOUSE_RELEASED, x, y, 22 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, point, point,
21 ui::EF_LEFT_MOUSE_BUTTON); 23 ui::EF_LEFT_MOUSE_BUTTON);
22 view->OnMouseReleased(release); 24 view->OnMouseReleased(release);
23 } 25 }
24 26
25 } 27 }
26 28
27 namespace views { 29 namespace views {
28 30
29 TEST(SliderTest, UpdateFromClick) { 31 TEST(SliderTest, UpdateFromClick) {
30 scoped_ptr<Slider> slider(new Slider(NULL, Slider::HORIZONTAL)); 32 scoped_ptr<Slider> slider(new Slider(NULL, Slider::HORIZONTAL));
31 View* view = slider.get(); 33 View* view = slider.get();
(...skipping 20 matching lines...) Expand all
52 EXPECT_EQ(1.0f, slider->value()); 54 EXPECT_EQ(1.0f, slider->value());
53 55
54 ClickAt(view, view->width(), 0); 56 ClickAt(view, view->width(), 0);
55 EXPECT_EQ(0.0f, slider->value()); 57 EXPECT_EQ(0.0f, slider->value());
56 58
57 // Reset locale. 59 // Reset locale.
58 base::i18n::SetICUDefaultLocale(locale); 60 base::i18n::SetICUDefaultLocale(locale);
59 } 61 }
60 62
61 } // namespace views 63 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/slider.cc ('k') | ui/views/controls/tabbed_pane/native_tabbed_pane_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698