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

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

Issue 586553002: Allow repeated handler removal/addition with the TouchEventQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 EXPECT_EQ(1U, view_->touch_event_.touchesLength); 912 EXPECT_EQ(1U, view_->touch_event_.touchesLength);
913 EXPECT_EQ(blink::WebTouchPoint::StatePressed, 913 EXPECT_EQ(blink::WebTouchPoint::StatePressed,
914 view_->touch_event_.touches[0].state); 914 view_->touch_event_.touches[0].state);
915 915
916 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); 916 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false));
917 EXPECT_TRUE(widget_host_->ShouldForwardTouchEvent()); 917 EXPECT_TRUE(widget_host_->ShouldForwardTouchEvent());
918 918
919 // Ack'ing the outstanding event should flush the pending touch queue. 919 // Ack'ing the outstanding event should flush the pending touch queue.
920 InputHostMsg_HandleInputEvent_ACK_Params ack; 920 InputHostMsg_HandleInputEvent_ACK_Params ack;
921 ack.type = blink::WebInputEvent::TouchStart; 921 ack.type = blink::WebInputEvent::TouchStart;
922 ack.state = INPUT_EVENT_ACK_STATE_CONSUMED; 922 ack.state = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
923 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); 923 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack));
924 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent()); 924 EXPECT_FALSE(widget_host_->ShouldForwardTouchEvent());
925 925
926 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, 926 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0,
927 base::Time::NowFromSystemTime() - base::Time()); 927 base::Time::NowFromSystemTime() - base::Time());
928 view_->OnTouchEvent(&move2); 928 view_->OnTouchEvent(&move2);
929 EXPECT_FALSE(move2.handled()); 929 EXPECT_FALSE(move2.handled());
930 EXPECT_EQ(blink::WebInputEvent::TouchMove, view_->touch_event_.type); 930 EXPECT_EQ(blink::WebInputEvent::TouchMove, view_->touch_event_.type);
931 EXPECT_EQ(1U, view_->touch_event_.touchesLength); 931 EXPECT_EQ(1U, view_->touch_event_.touchesLength);
932 EXPECT_EQ(blink::WebTouchPoint::StateMoved, 932 EXPECT_EQ(blink::WebTouchPoint::StateMoved,
(...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode()); 2778 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->completed_mode());
2779 2779
2780 SimulateGestureEvent(WebInputEvent::GestureScrollEnd, 2780 SimulateGestureEvent(WebInputEvent::GestureScrollEnd,
2781 blink::WebGestureDeviceTouchscreen); 2781 blink::WebGestureDeviceTouchscreen);
2782 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode()); 2782 EXPECT_EQ(OVERSCROLL_NONE, overscroll_delegate()->current_mode());
2783 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode()); 2783 EXPECT_EQ(OVERSCROLL_EAST, overscroll_delegate()->completed_mode());
2784 EXPECT_EQ(3U, sink_->message_count()); 2784 EXPECT_EQ(3U, sink_->message_count());
2785 } 2785 }
2786 2786
2787 } // namespace content 2787 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/touch_event_queue_unittest.cc ('k') | ui/events/gesture_detection/bitset_32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698