Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2317333002: Refactor EventHandler out of RenderWidgetHostViewAura (Closed)
Patch Set: Fix Windows Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <tuple> 10 #include <tuple>
(...skipping 22 matching lines...) Expand all
33 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 33 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
34 #include "content/browser/frame_host/render_widget_host_view_guest.h" 34 #include "content/browser/frame_host/render_widget_host_view_guest.h"
35 #include "content/browser/gpu/compositor_util.h" 35 #include "content/browser/gpu/compositor_util.h"
36 #include "content/browser/renderer_host/input/input_router.h" 36 #include "content/browser/renderer_host/input/input_router.h"
37 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h" 37 #include "content/browser/renderer_host/input/mouse_wheel_event_queue.h"
38 #include "content/browser/renderer_host/overscroll_controller.h" 38 #include "content/browser/renderer_host/overscroll_controller.h"
39 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 39 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
40 #include "content/browser/renderer_host/render_view_host_factory.h" 40 #include "content/browser/renderer_host/render_view_host_factory.h"
41 #include "content/browser/renderer_host/render_widget_host_delegate.h" 41 #include "content/browser/renderer_host/render_widget_host_delegate.h"
42 #include "content/browser/renderer_host/render_widget_host_impl.h" 42 #include "content/browser/renderer_host/render_widget_host_impl.h"
43 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
43 #include "content/browser/renderer_host/resize_lock.h" 44 #include "content/browser/renderer_host/resize_lock.h"
44 #include "content/browser/renderer_host/text_input_manager.h" 45 #include "content/browser/renderer_host/text_input_manager.h"
45 #include "content/browser/web_contents/web_contents_view_aura.h" 46 #include "content/browser/web_contents/web_contents_view_aura.h"
46 #include "content/common/host_shared_bitmap_manager.h" 47 #include "content/common/host_shared_bitmap_manager.h"
47 #include "content/common/input/synthetic_web_input_event_builders.h" 48 #include "content/common/input/synthetic_web_input_event_builders.h"
48 #include "content/common/input_messages.h" 49 #include "content/common/input_messages.h"
49 #include "content/common/text_input_state.h" 50 #include "content/common/text_input_state.h"
50 #include "content/common/view_messages.h" 51 #include "content/common/view_messages.h"
51 #include "content/public/browser/render_widget_host_view.h" 52 #include "content/public/browser/render_widget_host_view.h"
52 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" 53 #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
(...skipping 24 matching lines...) Expand all
77 #include "ui/base/clipboard/clipboard.h" 78 #include "ui/base/clipboard/clipboard.h"
78 #include "ui/base/ui_base_types.h" 79 #include "ui/base/ui_base_types.h"
79 #include "ui/compositor/compositor.h" 80 #include "ui/compositor/compositor.h"
80 #include "ui/compositor/layer_tree_owner.h" 81 #include "ui/compositor/layer_tree_owner.h"
81 #include "ui/compositor/test/draw_waiter_for_test.h" 82 #include "ui/compositor/test/draw_waiter_for_test.h"
82 #include "ui/events/blink/blink_event_util.h" 83 #include "ui/events/blink/blink_event_util.h"
83 #include "ui/events/blink/web_input_event_traits.h" 84 #include "ui/events/blink/web_input_event_traits.h"
84 #include "ui/events/event.h" 85 #include "ui/events/event.h"
85 #include "ui/events/event_utils.h" 86 #include "ui/events/event_utils.h"
86 #include "ui/events/gesture_detection/gesture_configuration.h" 87 #include "ui/events/gesture_detection/gesture_configuration.h"
88 #include "ui/events/gestures/motion_event_aura.h"
87 #include "ui/events/keycodes/dom/dom_code.h" 89 #include "ui/events/keycodes/dom/dom_code.h"
88 #include "ui/events/keycodes/dom/keycode_converter.h" 90 #include "ui/events/keycodes/dom/keycode_converter.h"
89 #include "ui/events/test/event_generator.h" 91 #include "ui/events/test/event_generator.h"
90 #include "ui/gfx/geometry/rect.h" 92 #include "ui/gfx/geometry/rect.h"
91 #include "ui/gfx/selection_bound.h" 93 #include "ui/gfx/selection_bound.h"
92 #include "ui/wm/core/default_activation_client.h" 94 #include "ui/wm/core/default_activation_client.h"
93 #include "ui/wm/core/default_screen_position_client.h" 95 #include "ui/wm/core/default_screen_position_client.h"
94 #include "ui/wm/core/window_util.h" 96 #include "ui/wm/core/window_util.h"
95 97
96 using testing::_; 98 using testing::_;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 390
389 // A lock that doesn't actually do anything to the compositor, and does not 391 // A lock that doesn't actually do anything to the compositor, and does not
390 // time out. 392 // time out.
391 class FakeResizeLock : public ResizeLock { 393 class FakeResizeLock : public ResizeLock {
392 public: 394 public:
393 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock) 395 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock)
394 : ResizeLock(new_size, defer_compositor_lock) {} 396 : ResizeLock(new_size, defer_compositor_lock) {}
395 }; 397 };
396 398
397 const ui::MotionEventAura& pointer_state_for_test() { 399 const ui::MotionEventAura& pointer_state_for_test() {
398 return pointer_state(); 400 return event_handler()->pointer_state();
399 } 401 }
400 402
401 bool can_create_resize_lock_; 403 bool can_create_resize_lock_;
402 gfx::Size last_frame_size_; 404 gfx::Size last_frame_size_;
403 std::unique_ptr<cc::CopyOutputRequest> last_copy_request_; 405 std::unique_ptr<cc::CopyOutputRequest> last_copy_request_;
404 FakeWindowEventDispatcher* dispatcher_; 406 FakeWindowEventDispatcher* dispatcher_;
405 }; 407 };
406 408
407 // A layout manager that always resizes a child to the root window size. 409 // A layout manager that always resizes a child to the root window size.
408 class FullscreenLayoutManager : public aura::LayoutManager { 410 class FullscreenLayoutManager : public aura::LayoutManager {
(...skipping 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after
4489 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); 4491 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
4490 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], 4492 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index],
4491 InputMsg_ImeCommitText::ID)); 4493 InputMsg_ImeCommitText::ID));
4492 } 4494 }
4493 } 4495 }
4494 4496
4495 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which 4497 // This test is for RenderWidgetHostViewAura::FinishImeCompositionSession which
4496 // is in response to a mouse click during an ongoing composition. 4498 // is in response to a mouse click during an ongoing composition.
4497 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) { 4499 TEST_F(InputMethodResultAuraTest, FinishImeCompositionSession) {
4498 base::Closure ime_finish_session_call = 4500 base::Closure ime_finish_session_call =
4499 base::Bind(&RenderWidgetHostViewAura::FinishImeCompositionSession, 4501 base::Bind(&RenderWidgetHostViewEventHandler::FinishImeCompositionSession,
4500 base::Unretained(tab_view())); 4502 base::Unretained(tab_view()->event_handler()));
4501 for (auto index : active_view_sequence_) { 4503 for (auto index : active_view_sequence_) {
4502 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); 4504 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
4503 SetHasCompositionTextToTrue(); 4505 SetHasCompositionTextToTrue();
4504 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call, 4506 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_finish_session_call,
4505 processes_[index], 4507 processes_[index],
4506 InputMsg_ImeFinishComposingText::ID)); 4508 InputMsg_ImeFinishComposingText::ID));
4507 } 4509 }
4508 } 4510 }
4509 4511
4510 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment. 4512 // This test is for ui::TextInputClient::ChangeTextDirectionAndLayoutAlignment.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
4682 4684
4683 // Retrieve the selected text from clipboard and verify it is as expected. 4685 // Retrieve the selected text from clipboard and verify it is as expected.
4684 base::string16 result_text; 4686 base::string16 result_text;
4685 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); 4687 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text);
4686 EXPECT_EQ(expected_text, result_text); 4688 EXPECT_EQ(expected_text, result_text);
4687 } 4689 }
4688 } 4690 }
4689 #endif 4691 #endif
4690 4692
4691 } // namespace content 4693 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698