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

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

Issue 101573006: Changes MouseEvent constructor to take changed_button_flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test; needs updated expectations as mouse entered wasnt sent before because of env::mouse_butto… Created 7 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 | Annotate | Revision Log
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/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/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 gfx::Point point(x, y); 18 gfx::Point point(x, y);
19 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, point, point, 19 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, point, point,
20 ui::EF_LEFT_MOUSE_BUTTON); 20 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
21 view->OnMousePressed(press); 21 view->OnMousePressed(press);
22 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, point, point, 22 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, point, point,
23 ui::EF_LEFT_MOUSE_BUTTON); 23 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
24 view->OnMouseReleased(release); 24 view->OnMouseReleased(release);
25 } 25 }
26 26
27 } 27 }
28 28
29 namespace views { 29 namespace views {
30 30
31 TEST(SliderTest, UpdateFromClickHorizontal) { 31 TEST(SliderTest, UpdateFromClickHorizontal) {
32 scoped_ptr<Slider> slider(new Slider(NULL, Slider::HORIZONTAL)); 32 scoped_ptr<Slider> slider(new Slider(NULL, Slider::HORIZONTAL));
33 View* view = slider.get(); 33 View* view = slider.get();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 EXPECT_EQ(1.0f, slider->value()); 67 EXPECT_EQ(1.0f, slider->value());
68 68
69 ClickAt(view, view->width(), 0); 69 ClickAt(view, view->width(), 0);
70 EXPECT_EQ(0.0f, slider->value()); 70 EXPECT_EQ(0.0f, slider->value());
71 71
72 // Reset locale. 72 // Reset locale.
73 base::i18n::SetICUDefaultLocale(locale); 73 base::i18n::SetICUDefaultLocale(locale);
74 } 74 }
75 75
76 } // namespace views 76 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/single_split_view_unittest.cc ('k') | ui/views/controls/table/table_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698