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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "ui/gfx/point.h" | 6 #include "ui/gfx/point.h" |
7 #include "ui/gfx/rect.h" | 7 #include "ui/gfx/rect.h" |
8 #include "ui/gfx/render_text.h" | 8 #include "ui/gfx/render_text.h" |
9 #include "ui/views/test/views_test_base.h" | 9 #include "ui/views/test/views_test_base.h" |
10 #include "ui/views/touchui/touch_selection_controller.h" | 10 #include "ui/views/touchui/touch_selection_controller.h" |
11 #include "ui/views/touchui/touch_selection_controller_impl.h" | 11 #include "ui/views/touchui/touch_selection_controller_impl.h" |
| 12 #include "ui/views/widget/widget.h" |
12 #include "views/controls/textfield/native_textfield_views.h" | 13 #include "views/controls/textfield/native_textfield_views.h" |
13 #include "views/controls/textfield/textfield.h" | 14 #include "views/controls/textfield/textfield.h" |
14 #include "views/widget/widget.h" | |
15 | 15 |
16 namespace views { | 16 namespace views { |
17 | 17 |
18 class TouchSelectionControllerImplTest : public ViewsTestBase { | 18 class TouchSelectionControllerImplTest : public ViewsTestBase { |
19 public: | 19 public: |
20 TouchSelectionControllerImplTest() | 20 TouchSelectionControllerImplTest() |
21 : widget_(NULL), | 21 : widget_(NULL), |
22 textfield_(NULL), | 22 textfield_(NULL), |
23 textfield_view_(NULL) { | 23 textfield_view_(NULL) { |
24 } | 24 } |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 VerifySelectionHandlePositions(true); | 332 VerifySelectionHandlePositions(true); |
333 | 333 |
334 // Drag selection handle 2 to right by 1 char. | 334 // Drag selection handle 2 to right by 1 char. |
335 x = textfield_->font().GetStringWidth(WideToUTF16(L"\x05e2")); | 335 x = textfield_->font().GetStringWidth(WideToUTF16(L"\x05e2")); |
336 SimulateSelectionHandleDrag(gfx::Point(x, 0), 2); | 336 SimulateSelectionHandleDrag(gfx::Point(x, 0), 2); |
337 EXPECT_EQ(WideToUTF16(L"c\x05e1"), textfield_->GetSelectedText()); | 337 EXPECT_EQ(WideToUTF16(L"c\x05e1"), textfield_->GetSelectedText()); |
338 VerifySelectionHandlePositions(false); | 338 VerifySelectionHandlePositions(false); |
339 } | 339 } |
340 | 340 |
341 } // namespace views | 341 } // namespace views |
OLD | NEW |