OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" | 5 #include "content/browser/renderer_host/input/touch_selection_controller_client_
aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 12 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 13 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h" |
13 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
14 #include "content/public/test/browser_test_utils.h" | 15 #include "content/public/test/browser_test_utils.h" |
15 #include "content/public/test/content_browser_test.h" | 16 #include "content/public/test/content_browser_test.h" |
16 #include "content/public/test/content_browser_test_utils.h" | 17 #include "content/public/test/content_browser_test_utils.h" |
17 #include "content/shell/browser/shell.h" | 18 #include "content/shell/browser/shell.h" |
18 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
19 #include "ui/aura/window_tree_host.h" | 20 #include "ui/aura/window_tree_host.h" |
20 #include "ui/display/display_switches.h" | 21 #include "ui/display/display_switches.h" |
21 #include "ui/events/event_utils.h" | 22 #include "ui/events/event_utils.h" |
22 #include "ui/events/test/event_generator.h" | 23 #include "ui/events/test/event_generator.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 TestTouchSelectionControllerClientAura* selection_controller_client() { | 162 TestTouchSelectionControllerClientAura* selection_controller_client() { |
162 return selection_controller_client_; | 163 return selection_controller_client_; |
163 } | 164 } |
164 | 165 |
165 void InitSelectionController() { | 166 void InitSelectionController() { |
166 RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura(); | 167 RenderWidgetHostViewAura* rwhva = GetRenderWidgetHostViewAura(); |
167 selection_controller_client_ = | 168 selection_controller_client_ = |
168 new TestTouchSelectionControllerClientAura(rwhva); | 169 new TestTouchSelectionControllerClientAura(rwhva); |
169 rwhva->SetSelectionControllerClientForTest( | 170 rwhva->SetSelectionControllerClientForTest( |
170 base::WrapUnique(selection_controller_client_)); | 171 base::WrapUnique(selection_controller_client_)); |
| 172 rwhva->event_handler()->disable_input_event_router_for_testing(); |
171 } | 173 } |
172 | 174 |
173 private: | 175 private: |
174 void SetUpOnMainThread() override { | 176 void SetUpOnMainThread() override { |
175 ContentBrowserTest::SetUpOnMainThread(); | 177 ContentBrowserTest::SetUpOnMainThread(); |
176 if (!ui::TouchSelectionMenuRunner::GetInstance()) | 178 if (!ui::TouchSelectionMenuRunner::GetInstance()) |
177 menu_runner_.reset(new TestTouchSelectionMenuRunner); | 179 menu_runner_.reset(new TestTouchSelectionMenuRunner); |
178 } | 180 } |
179 | 181 |
180 void TearDownOnMainThread() override { | 182 void TearDownOnMainThread() override { |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 | 713 |
712 // The handle should have moved to right. | 714 // The handle should have moved to right. |
713 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y()); | 715 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y()); |
714 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x()); | 716 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x()); |
715 | 717 |
716 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE, | 718 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE, |
717 rwhva->selection_controller()->active_status()); | 719 rwhva->selection_controller()->active_status()); |
718 } | 720 } |
719 | 721 |
720 } // namespace content | 722 } // namespace content |
OLD | NEW |