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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "ui/aura/client/screen_position_client.h" | 7 #include "ui/aura/client/screen_position_client.h" |
8 #include "ui/aura/test/test_cursor_client.h" | 8 #include "ui/aura/test/test_cursor_client.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 namespace views { | 60 namespace views { |
61 | 61 |
62 class TouchSelectionControllerImplTest : public ViewsTestBase { | 62 class TouchSelectionControllerImplTest : public ViewsTestBase { |
63 public: | 63 public: |
64 TouchSelectionControllerImplTest() | 64 TouchSelectionControllerImplTest() |
65 : textfield_widget_(nullptr), | 65 : textfield_widget_(nullptr), |
66 widget_(nullptr), | 66 widget_(nullptr), |
67 textfield_(nullptr), | 67 textfield_(nullptr), |
68 views_tsc_factory_(new ViewsTouchEditingControllerFactory) { | 68 views_tsc_factory_(new ViewsTouchEditingControllerFactory) { |
69 CommandLine::ForCurrentProcess()->AppendSwitch( | 69 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
70 switches::kEnableTouchEditing); | 70 switches::kEnableTouchEditing); |
71 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); | 71 ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); |
72 } | 72 } |
73 | 73 |
74 ~TouchSelectionControllerImplTest() override { | 74 ~TouchSelectionControllerImplTest() override { |
75 ui::TouchEditingControllerFactory::SetInstance(nullptr); | 75 ui::TouchEditingControllerFactory::SetInstance(nullptr); |
76 } | 76 } |
77 | 77 |
78 void SetUp() override { | 78 void SetUp() override { |
79 ViewsTestBase::SetUp(); | 79 ViewsTestBase::SetUp(); |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 // Start touch editing; then press a key and ensure it deactivates touch | 877 // Start touch editing; then press a key and ensure it deactivates touch |
878 // selection. | 878 // selection. |
879 StartTouchEditing(); | 879 StartTouchEditing(); |
880 EXPECT_TRUE(GetSelectionController()); | 880 EXPECT_TRUE(GetSelectionController()); |
881 generator.PressKey(ui::VKEY_A, 0); | 881 generator.PressKey(ui::VKEY_A, 0); |
882 RunPendingMessages(); | 882 RunPendingMessages(); |
883 EXPECT_FALSE(GetSelectionController()); | 883 EXPECT_FALSE(GetSelectionController()); |
884 } | 884 } |
885 | 885 |
886 } // namespace views | 886 } // namespace views |
OLD | NEW |