| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 10 #include "ui/aura/client/screen_position_client.h" |
| 11 #include "ui/aura/test/test_cursor_client.h" | 11 #include "ui/aura/test/test_cursor_client.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/aura/window_event_dispatcher.h" | |
| 14 #include "ui/aura/window_tree_host.h" | |
| 15 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/base/touch/touch_editing_controller.h" | 14 #include "ui/base/touch/touch_editing_controller.h" |
| 17 #include "ui/base/ui_base_switches.h" | 15 #include "ui/base/ui_base_switches.h" |
| 18 #include "ui/events/event_utils.h" | 16 #include "ui/events/event_utils.h" |
| 19 #include "ui/events/test/event_generator.h" | 17 #include "ui/events/test/event_generator.h" |
| 20 #include "ui/gfx/canvas.h" | 18 #include "ui/gfx/canvas.h" |
| 21 #include "ui/gfx/geometry/point.h" | 19 #include "ui/gfx/geometry/point.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
| 23 #include "ui/gfx/render_text.h" | 21 #include "ui/gfx/render_text.h" |
| 24 #include "ui/resources/grit/ui_resources.h" | 22 #include "ui/resources/grit/ui_resources.h" |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 EXPECT_FALSE(IsCursorHandleVisibleFor(touch_selection_controller.get())); | 787 EXPECT_FALSE(IsCursorHandleVisibleFor(touch_selection_controller.get())); |
| 790 | 788 |
| 791 touch_selection_controller.reset(); | 789 touch_selection_controller.reset(); |
| 792 } | 790 } |
| 793 | 791 |
| 794 TEST_F(TouchSelectionControllerImplTest, HandlesStackAboveParent) { | 792 TEST_F(TouchSelectionControllerImplTest, HandlesStackAboveParent) { |
| 795 // TODO: see comment in SetUp(). | 793 // TODO: see comment in SetUp(). |
| 796 if (IsMus()) | 794 if (IsMus()) |
| 797 return; | 795 return; |
| 798 | 796 |
| 799 aura::Window* root = GetContext(); | 797 ui::EventTarget* root = GetContext(); |
| 800 ui::EventTargeter* targeter = | 798 ui::EventTargeter* targeter = root->GetEventTargeter(); |
| 801 root->GetHost()->dispatcher()->GetDefaultEventTargeter(); | |
| 802 | 799 |
| 803 // Create the first window containing a Views::Textfield. | 800 // Create the first window containing a Views::Textfield. |
| 804 CreateTextfield(); | 801 CreateTextfield(); |
| 805 aura::Window* window1 = textfield_widget_->GetNativeView(); | 802 aura::Window* window1 = textfield_widget_->GetNativeView(); |
| 806 | 803 |
| 807 // Start touch editing, check that the handle is above the first window, and | 804 // Start touch editing, check that the handle is above the first window, and |
| 808 // end touch editing. | 805 // end touch editing. |
| 809 StartTouchEditing(); | 806 StartTouchEditing(); |
| 810 gfx::Point test_point = GetCursorHandleDragPoint(); | 807 gfx::Point test_point = GetCursorHandleDragPoint(); |
| 811 ui::MouseEvent test_event1(ui::ET_MOUSE_MOVED, test_point, test_point, | 808 ui::MouseEvent test_event1(ui::ET_MOUSE_MOVED, test_point, test_point, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 // Start touch editing; then press a key and ensure it deactivates touch | 915 // Start touch editing; then press a key and ensure it deactivates touch |
| 919 // selection. | 916 // selection. |
| 920 StartTouchEditing(); | 917 StartTouchEditing(); |
| 921 EXPECT_TRUE(GetSelectionController()); | 918 EXPECT_TRUE(GetSelectionController()); |
| 922 generator.PressKey(ui::VKEY_A, 0); | 919 generator.PressKey(ui::VKEY_A, 0); |
| 923 RunPendingMessages(); | 920 RunPendingMessages(); |
| 924 EXPECT_FALSE(GetSelectionController()); | 921 EXPECT_FALSE(GetSelectionController()); |
| 925 } | 922 } |
| 926 | 923 |
| 927 } // namespace views | 924 } // namespace views |
| OLD | NEW |