Index: content/renderer/mus/compositor_mus_connection_unittest.cc |
diff --git a/content/renderer/mus/compositor_mus_connection_unittest.cc b/content/renderer/mus/compositor_mus_connection_unittest.cc |
index e9ee52f4fef6231bd28ed800e5f25ec50489b80c..36bc22eb49266e10434596d0ebacbe26c21ce4ac 100644 |
--- a/content/renderer/mus/compositor_mus_connection_unittest.cc |
+++ b/content/renderer/mus/compositor_mus_connection_unittest.cc |
@@ -79,10 +79,10 @@ class TestInputHandlerManager : public content::InputHandlerManager { |
void SetHandleInputEventResult(content::InputEventAckState result); |
// content::InputHandlerManager: |
- content::InputEventAckState HandleInputEvent( |
- int routing_id, |
- const blink::WebInputEvent* input_event, |
- ui::LatencyInfo* latency_info) override; |
+ void HandleInputEvent(int routing_id, |
+ ui::ScopedWebInputEvent input_event, |
+ const ui::LatencyInfo& latency_info, |
+ const InputEventAckStateCallback& callback) override; |
private: |
// If true content::InputHandlerManager::HandleInputEvent is not called. |
@@ -104,14 +104,17 @@ void TestInputHandlerManager::SetHandleInputEventResult( |
result_ = result; |
} |
-content::InputEventAckState TestInputHandlerManager::HandleInputEvent( |
+void TestInputHandlerManager::HandleInputEvent( |
int routing_id, |
- const blink::WebInputEvent* input_event, |
- ui::LatencyInfo* latency_info) { |
- if (override_result_) |
- return result_; |
- return content::InputHandlerManager::HandleInputEvent(routing_id, input_event, |
- latency_info); |
+ ui::ScopedWebInputEvent input_event, |
+ const ui::LatencyInfo& latency_info, |
+ const InputEventAckStateCallback& callback) { |
+ if (override_result_) { |
+ callback.Run(result_, std::move(input_event), latency_info, nullptr); |
+ return; |
+ } |
+ content::InputHandlerManager::HandleInputEvent( |
+ routing_id, std::move(input_event), latency_info, callback); |
} |
// Empty implementation of InputHandlerManagerClient. |
@@ -422,7 +425,7 @@ TEST_F(CompositorMusConnectionTest, LostAck) { |
} |
// Tests that when an input handler consumes the event, that |
-// CompositorMusConnection does not consume the ack, nor calls it. |
+// CompositorMusConnection will consume the ack, but call as UNHANDLED. |
TEST_F(CompositorMusConnectionTest, InputHandlerConsumes) { |
input_handler_manager()->SetHandleInputEventResult( |
InputEventAckState::INPUT_EVENT_ACK_STATE_CONSUMED); |
@@ -435,13 +438,14 @@ TEST_F(CompositorMusConnectionTest, InputHandlerConsumes) { |
OnWindowInputEvent(&test_window, *event.get(), &ack_callback); |
- EXPECT_TRUE(ack_callback.get()); |
+ EXPECT_FALSE(ack_callback.get()); |
VerifyAndRunQueues(false, false); |
- EXPECT_FALSE(test_callback->called()); |
+ EXPECT_TRUE(test_callback->called()); |
+ EXPECT_EQ(EventResult::UNHANDLED, test_callback->result()); |
} |
// Tests that when the renderer will not ack an event, that |
-// CompositorMusConnection does not consume the ack, nor calls it. |
+// CompositorMusConnection will consume the ack, but call as UNHANDLED. |
TEST_F(CompositorMusConnectionTest, RendererWillNotSendAck) { |
ui::TestWindow test_window; |
ui::PointerEvent event( |
@@ -455,10 +459,11 @@ TEST_F(CompositorMusConnectionTest, RendererWillNotSendAck) { |
base::Bind(&::TestCallback::ResultCallback, test_callback))); |
OnWindowInputEvent(&test_window, event, &ack_callback); |
- EXPECT_TRUE(ack_callback.get()); |
+ EXPECT_FALSE(ack_callback.get()); |
VerifyAndRunQueues(true, false); |
- EXPECT_FALSE(test_callback->called()); |
+ EXPECT_TRUE(test_callback->called()); |
+ EXPECT_EQ(EventResult::UNHANDLED, test_callback->result()); |
} |
// Tests that when a touch event id provided, that CompositorMusConnection |