Commit ce3cbf95 authored by jdduke's avatar jdduke Committed by Commit bot

Remove unnecessary DCHECK in TouchEventQueue handler notification

Previously, the TouchEventQueue would flush itself when notified that
all touch handlers have been removed. As that is no longer the case,
remove the assert verifying that the queue is empty when notified that
a touch handler has been added.

BUG=406916

Review URL: https://codereview.chromium.org/569793003

Cr-Commit-Position: refs/heads/master@{#294711}
parent 3a2f9031
...@@ -626,7 +626,6 @@ void TouchEventQueue::OnHasTouchEventHandlers(bool has_handlers) { ...@@ -626,7 +626,6 @@ void TouchEventQueue::OnHasTouchEventHandlers(bool has_handlers) {
if (touch_filtering_state_ == DROP_ALL_TOUCHES) { if (touch_filtering_state_ == DROP_ALL_TOUCHES) {
// If no touch handler was previously registered, ensure that we don't // If no touch handler was previously registered, ensure that we don't
// send a partial touch sequence to the renderer. // send a partial touch sequence to the renderer.
DCHECK(touch_queue_.empty());
touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE;
} }
} else { } else {
......
...@@ -388,6 +388,15 @@ TEST_F(TouchEventQueueTest, ActiveSequenceDroppedWhenHandlersRemoved) { ...@@ -388,6 +388,15 @@ TEST_F(TouchEventQueueTest, ActiveSequenceDroppedWhenHandlersRemoved) {
EXPECT_EQ(0U, GetAndResetAckedEventCount()); EXPECT_EQ(0U, GetAndResetAckedEventCount());
EXPECT_EQ(2U, queued_event_count()); EXPECT_EQ(2U, queued_event_count());
// Repeated registration/unregstration of handlers should have no effect as
// we're still awaiting the ack arrival.
OnHasTouchEventHandlers(true);
EXPECT_EQ(0U, GetAndResetAckedEventCount());
EXPECT_EQ(2U, queued_event_count());
OnHasTouchEventHandlers(false);
EXPECT_EQ(0U, GetAndResetAckedEventCount());
EXPECT_EQ(2U, queued_event_count());
// The ack should be flush the queue. // The ack should be flush the queue.
SendTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); SendTouchEventAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS);
EXPECT_EQ(2U, GetAndResetAckedEventCount()); EXPECT_EQ(2U, GetAndResetAckedEventCount());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment