| 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 "components/mus/public/cpp/tests/test_window.h" | 13 #include "components/mus/public/cpp/tests/test_window.h" |
| 14 #include "components/mus/public/interfaces/input_event_constants.mojom.h" | |
| 15 #include "components/mus/public/interfaces/input_events.mojom.h" | |
| 16 #include "components/mus/public/interfaces/input_key_codes.mojom.h" | |
| 17 #include "content/common/input/did_overscroll_params.h" | 14 #include "content/common/input/did_overscroll_params.h" |
| 18 #include "content/common/input/input_event_ack.h" | 15 #include "content/common/input/input_event_ack.h" |
| 19 #include "content/common/input/input_event_ack_state.h" | 16 #include "content/common/input/input_event_ack_state.h" |
| 20 #include "content/public/test/mock_render_thread.h" | 17 #include "content/public/test/mock_render_thread.h" |
| 21 #include "content/renderer/input/input_handler_manager.h" | 18 #include "content/renderer/input/input_handler_manager.h" |
| 22 #include "content/renderer/input/input_handler_manager_client.h" | 19 #include "content/renderer/input/input_handler_manager_client.h" |
| 23 #include "content/renderer/input/render_widget_input_handler.h" | 20 #include "content/renderer/input/render_widget_input_handler.h" |
| 24 #include "content/renderer/mus/render_widget_mus_connection.h" | 21 #include "content/renderer/mus/render_widget_mus_connection.h" |
| 25 #include "content/renderer/render_widget.h" | 22 #include "content/renderer/render_widget.h" |
| 26 #include "content/test/fake_compositor_dependencies.h" | 23 #include "content/test/fake_compositor_dependencies.h" |
| 27 #include "content/test/fake_renderer_scheduler.h" | 24 #include "content/test/fake_renderer_scheduler.h" |
| 28 #include "mojo/public/cpp/bindings/interface_request.h" | 25 #include "mojo/public/cpp/bindings/interface_request.h" |
| 29 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 30 #include "ui/events/event_utils.h" | 27 #include "ui/events/event_utils.h" |
| 28 #include "ui/events/mojo/event.mojom.h" |
| 29 #include "ui/events/mojo/event_constants.mojom.h" |
| 30 #include "ui/events/mojo/keyboard_codes.mojom.h" |
| 31 | 31 |
| 32 using mus::mojom::EventResult; | 32 using mus::mojom::EventResult; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // Wrapper for the callback provided to | 36 // Wrapper for the callback provided to |
| 37 // CompositorMusConnection:OnWindowInputEvent. This tracks whether the it was | 37 // CompositorMusConnection:OnWindowInputEvent. This tracks whether the it was |
| 38 // called, along with the result. | 38 // called, along with the result. |
| 39 class TestCallback : public base::RefCounted<TestCallback> { | 39 class TestCallback : public base::RefCounted<TestCallback> { |
| 40 public: | 40 public: |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 EXPECT_FALSE(ack_callback.get()); | 481 EXPECT_FALSE(ack_callback.get()); |
| 482 | 482 |
| 483 VerifyAndRunQueues(true, true); | 483 VerifyAndRunQueues(true, true); |
| 484 | 484 |
| 485 // The ack callback should have been called | 485 // The ack callback should have been called |
| 486 EXPECT_TRUE(test_callback->called()); | 486 EXPECT_TRUE(test_callback->called()); |
| 487 EXPECT_EQ(EventResult::HANDLED, test_callback->result()); | 487 EXPECT_EQ(EventResult::HANDLED, test_callback->result()); |
| 488 } | 488 } |
| 489 | 489 |
| 490 } // namespace content | 490 } // namespace content |
| OLD | NEW |