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

Side by Side Diff: ui/base/events/event_dispatcher_unittest.cc

Issue 10964051: events: Clean up dispatching code for touch-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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 | Annotate | Revision Log
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 "ui/base/events/event_dispatcher.h" 5 #include "ui/base/events/event_dispatcher.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE { 71 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE {
72 ReceivedEvent(event); 72 ReceivedEvent(event);
73 return event_result_; 73 return event_result_;
74 } 74 }
75 75
76 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE { 76 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE {
77 ReceivedEvent(event); 77 ReceivedEvent(event);
78 return event_result_; 78 return event_result_;
79 } 79 }
80 80
81 virtual TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE { 81 virtual EventResult OnTouchEvent(TouchEvent* event) OVERRIDE {
82 ReceivedEvent(event); 82 ReceivedEvent(event);
83 return ui::TOUCH_STATUS_UNKNOWN; 83 return event_result_;
84 } 84 }
85 85
86 virtual EventResult OnGestureEvent(GestureEvent* event) OVERRIDE { 86 virtual EventResult OnGestureEvent(GestureEvent* event) OVERRIDE {
87 ReceivedEvent(event); 87 ReceivedEvent(event);
88 return event_result_; 88 return event_result_;
89 } 89 }
90 90
91 int id_; 91 int id_;
92 EventResult event_result_; 92 EventResult event_result_;
93 EventPhase expected_phase_; 93 EventPhase expected_phase_;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 EXPECT_EQ(EP_POSTDISPATCH, mouse.phase()); 194 EXPECT_EQ(EP_POSTDISPATCH, mouse.phase());
195 EXPECT_EQ(result, mouse.result()); 195 EXPECT_EQ(result, mouse.result());
196 EXPECT_TRUE(result & ER_CONSUMED); 196 EXPECT_TRUE(result & ER_CONSUMED);
197 EXPECT_FALSE(result & ER_HANDLED); 197 EXPECT_FALSE(result & ER_HANDLED);
198 EXPECT_EQ( 198 EXPECT_EQ(
199 std::vector<int>(exp, exp + sizeof(exp) / sizeof(int)), 199 std::vector<int>(exp, exp + sizeof(exp) / sizeof(int)),
200 child.handler_list()); 200 child.handler_list());
201 } 201 }
202 202
203 } // namespace ui 203 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698