| 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 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/threading/thread_task_runner_handle.h" | 17 #include "base/threading/thread_task_runner_handle.h" |
| 18 #include "base/timer/timer.h" | 18 #include "base/timer/timer.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "content/browser/browser_thread_impl.h" | 20 #include "content/browser/browser_thread_impl.h" |
| 21 #include "content/browser/gpu/compositor_util.h" | 21 #include "content/browser/gpu/compositor_util.h" |
| 22 #include "content/browser/renderer_host/input/input_router_impl.h" | 22 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 23 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 23 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 25 #include "content/common/input/synthetic_web_input_event_builders.h" | 25 #include "content/common/input/synthetic_web_input_event_builders.h" |
| 26 #include "content/common/input/web_input_event_traits.h" | |
| 27 #include "content/common/input_messages.h" | 26 #include "content/common/input_messages.h" |
| 28 #include "content/common/resize_params.h" | 27 #include "content/common/resize_params.h" |
| 29 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
| 30 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 31 #include "content/public/test/mock_render_process_host.h" | 30 #include "content/public/test/mock_render_process_host.h" |
| 32 #include "content/public/test/test_browser_context.h" | 31 #include "content/public/test/test_browser_context.h" |
| 33 #include "content/test/test_render_view_host.h" | 32 #include "content/test/test_render_view_host.h" |
| 34 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 35 #include "ui/display/screen.h" | 34 #include "ui/display/screen.h" |
| 35 #include "ui/events/blink/web_input_event_traits.h" |
| 36 #include "ui/events/keycodes/keyboard_codes.h" | 36 #include "ui/events/keycodes/keyboard_codes.h" |
| 37 #include "ui/gfx/canvas.h" | 37 #include "ui/gfx/canvas.h" |
| 38 | 38 |
| 39 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
| 40 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" | 40 #include "content/browser/renderer_host/context_provider_factory_impl_android.h" |
| 41 #include "content/browser/renderer_host/render_widget_host_view_android.h" | 41 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if defined(USE_AURA) || defined(OS_MACOSX) | 44 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 45 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 45 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 67 std::string GetInputMessageTypes(MockRenderProcessHost* process) { | 67 std::string GetInputMessageTypes(MockRenderProcessHost* process) { |
| 68 std::string result; | 68 std::string result; |
| 69 for (size_t i = 0; i < process->sink().message_count(); ++i) { | 69 for (size_t i = 0; i < process->sink().message_count(); ++i) { |
| 70 const IPC::Message* message = process->sink().GetMessageAt(i); | 70 const IPC::Message* message = process->sink().GetMessageAt(i); |
| 71 EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type()); | 71 EXPECT_EQ(InputMsg_HandleInputEvent::ID, message->type()); |
| 72 InputMsg_HandleInputEvent::Param params; | 72 InputMsg_HandleInputEvent::Param params; |
| 73 EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); | 73 EXPECT_TRUE(InputMsg_HandleInputEvent::Read(message, ¶ms)); |
| 74 const WebInputEvent* event = std::get<0>(params); | 74 const WebInputEvent* event = std::get<0>(params); |
| 75 if (i != 0) | 75 if (i != 0) |
| 76 result += " "; | 76 result += " "; |
| 77 result += WebInputEventTraits::GetName(event->type); | 77 result += ui::WebInputEventTraits::GetName(event->type); |
| 78 } | 78 } |
| 79 process->sink().ClearMessages(); | 79 process->sink().ClearMessages(); |
| 80 return result; | 80 return result; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // MockInputRouter ------------------------------------------------------------- | 83 // MockInputRouter ------------------------------------------------------------- |
| 84 | 84 |
| 85 class MockInputRouter : public InputRouter { | 85 class MockInputRouter : public InputRouter { |
| 86 public: | 86 public: |
| 87 explicit MockInputRouter(InputRouterClient* client) | 87 explicit MockInputRouter(InputRouterClient* client) |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 ui::LatencyInfo()); | 1703 ui::LatencyInfo()); |
| 1704 | 1704 |
| 1705 | 1705 |
| 1706 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). | 1706 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). |
| 1707 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); | 1707 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); |
| 1708 | 1708 |
| 1709 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1709 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 } // namespace content | 1712 } // namespace content |
| OLD | NEW |