| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "ui/aura/client/focus_client.h" | 12 #include "ui/aura/client/focus_client.h" |
| 13 #include "ui/aura/env.h" | 13 #include "ui/aura/env.h" |
| 14 #include "ui/aura/test/event_generator.h" |
| 14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 15 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/base/ui_base_paths.h" | 18 #include "ui/base/ui_base_paths.h" |
| 18 #include "ui/base/ui_base_switches.h" | 19 #include "ui/base/ui_base_switches.h" |
| 19 #include "ui/events/event_processor.h" | 20 #include "ui/events/event_processor.h" |
| 20 #include "ui/events/test/event_generator.h" | |
| 21 #include "ui/gfx/native_widget_types.h" | 21 #include "ui/gfx/native_widget_types.h" |
| 22 #include "ui/gl/gl_surface.h" | 22 #include "ui/gl/gl_surface.h" |
| 23 #include "ui/views/controls/textfield/textfield.h" | 23 #include "ui/views/controls/textfield/textfield.h" |
| 24 #include "ui/views/controls/textfield/textfield_test_api.h" | 24 #include "ui/views/controls/textfield/textfield_test_api.h" |
| 25 #include "ui/views/test/widget_test.h" | 25 #include "ui/views/test/widget_test.h" |
| 26 #include "ui/views/touchui/touch_selection_controller_impl.h" | 26 #include "ui/views/touchui/touch_selection_controller_impl.h" |
| 27 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
| 28 #include "ui/views/window/dialog_delegate.h" | 28 #include "ui/views/window/dialog_delegate.h" |
| 29 #include "ui/wm/public/activation_client.h" | 29 #include "ui/wm/public/activation_client.h" |
| 30 | 30 |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 textfield->SetText(base::ASCIIToUTF16("some text")); | 762 textfield->SetText(base::ASCIIToUTF16("some text")); |
| 763 widget.GetRootView()->AddChildView(textfield); | 763 widget.GetRootView()->AddChildView(textfield); |
| 764 | 764 |
| 765 widget.Show(); | 765 widget.Show(); |
| 766 textfield->RequestFocus(); | 766 textfield->RequestFocus(); |
| 767 textfield->SelectAll(true); | 767 textfield->SelectAll(true); |
| 768 TextfieldTestApi textfield_test_api(textfield); | 768 TextfieldTestApi textfield_test_api(textfield); |
| 769 | 769 |
| 770 RunPendingMessages(); | 770 RunPendingMessages(); |
| 771 | 771 |
| 772 ui::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow()); | 772 aura::test::EventGenerator generator(widget.GetNativeView()->GetRootWindow()); |
| 773 generator.GestureTapAt(gfx::Point(10, 10)); | 773 generator.GestureTapAt(gfx::Point(10, 10)); |
| 774 ShowQuickMenuImmediately(static_cast<TouchSelectionControllerImpl*>( | 774 ShowQuickMenuImmediately(static_cast<TouchSelectionControllerImpl*>( |
| 775 textfield_test_api.touch_selection_controller())); | 775 textfield_test_api.touch_selection_controller())); |
| 776 | 776 |
| 777 EXPECT_TRUE(textfield->HasFocus()); | 777 EXPECT_TRUE(textfield->HasFocus()); |
| 778 EXPECT_TRUE(widget.IsActive()); | 778 EXPECT_TRUE(widget.IsActive()); |
| 779 EXPECT_TRUE(IsQuickMenuVisible(static_cast<TouchSelectionControllerImpl*>( | 779 EXPECT_TRUE(IsQuickMenuVisible(static_cast<TouchSelectionControllerImpl*>( |
| 780 textfield_test_api.touch_selection_controller()))); | 780 textfield_test_api.touch_selection_controller()))); |
| 781 } | 781 } |
| 782 | 782 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 ui::EventDispatchDetails details = widget1.GetNativeWindow()-> | 1078 ui::EventDispatchDetails details = widget1.GetNativeWindow()-> |
| 1079 GetHost()->event_processor()->OnEventFromSource(&mouse_event); | 1079 GetHost()->event_processor()->OnEventFromSource(&mouse_event); |
| 1080 ASSERT_FALSE(details.dispatcher_destroyed); | 1080 ASSERT_FALSE(details.dispatcher_destroyed); |
| 1081 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); | 1081 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); |
| 1082 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); | 1082 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); |
| 1083 } | 1083 } |
| 1084 #endif | 1084 #endif |
| 1085 | 1085 |
| 1086 } // namespace test | 1086 } // namespace test |
| 1087 } // namespace views | 1087 } // namespace views |
| OLD | NEW |