Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 521453002: Defer flushing the touch queue when all touch handlers removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Aura unit test fix Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/input/touch_event_queue_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 882
883 // Now start a touch event, and remove the event-handlers before the release. 883 // Now start a touch event, and remove the event-handlers before the release.
884 view_->OnTouchEvent(&press); 884 view_->OnTouchEvent(&press);
885 EXPECT_TRUE(press.stopped_propagation()); 885 EXPECT_TRUE(press.stopped_propagation());
886 EXPECT_EQ(blink::WebInputEvent::TouchStart, view_->touch_event_.type); 886 EXPECT_EQ(blink::WebInputEvent::TouchStart, view_->touch_event_.type);
887 EXPECT_EQ(1U, view_->touch_event_.touchesLength); 887 EXPECT_EQ(1U, view_->touch_event_.touchesLength);
888 EXPECT_EQ(blink::WebTouchPoint::StatePressed, 888 EXPECT_EQ(blink::WebTouchPoint::StatePressed,
889 view_->touch_event_.touches[0].state); 889 view_->touch_event_.touches[0].state);
890 890
891 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); 891 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
892 EXPECT_TRUE(widget_host_->ShouldForwardTouchEvent());
893
894 // Ack'ing the outstanding event should flush the pending touch queue.
895 InputHostMsg_HandleInputEvent_ACK_Params ack;
896 ack.type = blink::WebInputEvent::TouchStart;
897 ack.state = INPUT_EVENT_ACK_STATE_CONSUMED;
898 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack));
892 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent()); 899 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent());
893 900
894 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, 901 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0,
895 base::Time::NowFromSystemTime() - base::Time()); 902 base::Time::NowFromSystemTime() - base::Time());
896 view_->OnTouchEvent(&move2); 903 view_->OnTouchEvent(&move2);
897 EXPECT_FALSE(move2.handled()); 904 EXPECT_FALSE(move2.handled());
898 EXPECT_EQ(blink::WebInputEvent::TouchMove, view_->touch_event_.type); 905 EXPECT_EQ(blink::WebInputEvent::TouchMove, view_->touch_event_.type);
899 EXPECT_EQ(1U, view_->touch_event_.touchesLength); 906 EXPECT_EQ(1U, view_->touch_event_.touchesLength);
900 EXPECT_EQ(blink::WebTouchPoint::StateMoved, 907 EXPECT_EQ(blink::WebTouchPoint::StateMoved,
901 view_->touch_event_.touches[0].state); 908 view_->touch_event_.touches[0].state);
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2747 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); 2754 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode());
2748 2755
2749 SimulateGestureEvent(WebInputEvent::GestureScrollEnd, 2756 SimulateGestureEvent(WebInputEvent::GestureScrollEnd,
2750 blink::WebGestureDeviceTouchscreen); 2757 blink::WebGestureDeviceTouchscreen);
2751 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); 2758 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode());
2752 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); 2759 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode());
2753 EXPECT_EQ(3U, sink_->message_count()); 2760 EXPECT_EQ(3U, sink_->message_count());
2754 } 2761 }
2755 2762
2756 } // namespace content 2763 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/touch_event_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698