| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/renderer/mus/compositor_mus_connection.h" | 5 #include "content/renderer/mus/compositor_mus_connection.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/test/test_simple_task_runner.h" | 11 #include "base/test/test_simple_task_runner.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/common/input/did_overscroll_params.h" | |
| 14 #include "content/common/input/input_event_ack.h" | 13 #include "content/common/input/input_event_ack.h" |
| 15 #include "content/common/input/input_event_ack_state.h" | 14 #include "content/common/input/input_event_ack_state.h" |
| 16 #include "content/public/test/mock_render_thread.h" | 15 #include "content/public/test/mock_render_thread.h" |
| 17 #include "content/renderer/input/input_handler_manager.h" | 16 #include "content/renderer/input/input_handler_manager.h" |
| 18 #include "content/renderer/input/input_handler_manager_client.h" | 17 #include "content/renderer/input/input_handler_manager_client.h" |
| 19 #include "content/renderer/input/render_widget_input_handler.h" | 18 #include "content/renderer/input/render_widget_input_handler.h" |
| 20 #include "content/renderer/mus/render_widget_mus_connection.h" | 19 #include "content/renderer/mus/render_widget_mus_connection.h" |
| 21 #include "content/renderer/render_widget.h" | 20 #include "content/renderer/render_widget.h" |
| 22 #include "content/test/fake_compositor_dependencies.h" | 21 #include "content/test/fake_compositor_dependencies.h" |
| 23 #include "mojo/public/cpp/bindings/interface_request.h" | 22 #include "mojo/public/cpp/bindings/interface_request.h" |
| 24 #include "services/ui/public/cpp/tests/test_window.h" | 23 #include "services/ui/public/cpp/tests/test_window.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 26 #include "third_party/WebKit/public/platform/scheduler/test/fake_renderer_schedu
ler.h" | 25 #include "third_party/WebKit/public/platform/scheduler/test/fake_renderer_schedu
ler.h" |
| 26 #include "ui/events/blink/did_overscroll_params.h" |
| 27 #include "ui/events/event_utils.h" | 27 #include "ui/events/event_utils.h" |
| 28 #include "ui/events/mojo/event.mojom.h" | 28 #include "ui/events/mojo/event.mojom.h" |
| 29 #include "ui/events/mojo/event_constants.mojom.h" | 29 #include "ui/events/mojo/event_constants.mojom.h" |
| 30 #include "ui/events/mojo/keyboard_codes.mojom.h" | 30 #include "ui/events/mojo/keyboard_codes.mojom.h" |
| 31 | 31 |
| 32 using ui::mojom::EventResult; | 32 using ui::mojom::EventResult; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // Wrapper for the callback provided to | 36 // Wrapper for the callback provided to |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 : public content::InputHandlerManagerClient { | 119 : public content::InputHandlerManagerClient { |
| 120 public: | 120 public: |
| 121 TestInputHandlerManagerClient() {} | 121 TestInputHandlerManagerClient() {} |
| 122 ~TestInputHandlerManagerClient() override{}; | 122 ~TestInputHandlerManagerClient() override{}; |
| 123 | 123 |
| 124 // content::InputHandlerManagerClient: | 124 // content::InputHandlerManagerClient: |
| 125 void SetBoundHandler(const Handler& handler) override {} | 125 void SetBoundHandler(const Handler& handler) override {} |
| 126 void RegisterRoutingID(int routing_id) override {} | 126 void RegisterRoutingID(int routing_id) override {} |
| 127 void UnregisterRoutingID(int routing_id) override {} | 127 void UnregisterRoutingID(int routing_id) override {} |
| 128 void DidOverscroll(int routing_id, | 128 void DidOverscroll(int routing_id, |
| 129 const content::DidOverscrollParams& params) override {} | 129 const ui::DidOverscrollParams& params) override {} |
| 130 void DidStartFlinging(int routing_id) override {} | 130 void DidStartFlinging(int routing_id) override {} |
| 131 void DidStopFlinging(int routing_id) override {} | 131 void DidStopFlinging(int routing_id) override {} |
| 132 void NotifyInputEventHandled( | 132 void NotifyInputEventHandled( |
| 133 int routing_id, | 133 int routing_id, |
| 134 blink::WebInputEvent::Type type, | 134 blink::WebInputEvent::Type type, |
| 135 content::InputEventAckState ack_result) override {} | 135 content::InputEventAckState ack_result) override {} |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 DISALLOW_COPY_AND_ASSIGN(TestInputHandlerManagerClient); | 138 DISALLOW_COPY_AND_ASSIGN(TestInputHandlerManagerClient); |
| 139 }; | 139 }; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 EXPECT_FALSE(ack_callback.get()); | 483 EXPECT_FALSE(ack_callback.get()); |
| 484 | 484 |
| 485 VerifyAndRunQueues(true, true); | 485 VerifyAndRunQueues(true, true); |
| 486 | 486 |
| 487 // The ack callback should have been called | 487 // The ack callback should have been called |
| 488 EXPECT_TRUE(test_callback->called()); | 488 EXPECT_TRUE(test_callback->called()); |
| 489 EXPECT_EQ(EventResult::HANDLED, test_callback->result()); | 489 EXPECT_EQ(EventResult::HANDLED, test_callback->result()); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace content | 492 } // namespace content |
| OLD | NEW |