| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE { | 84 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE { |
| 85 ReceivedEvent(event); | 85 ReceivedEvent(event); |
| 86 return event_result_; | 86 return event_result_; |
| 87 } | 87 } |
| 88 | 88 |
| 89 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE { | 89 virtual EventResult OnScrollEvent(ScrollEvent* event) OVERRIDE { |
| 90 ReceivedEvent(event); | 90 ReceivedEvent(event); |
| 91 return event_result_; | 91 return event_result_; |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual TouchStatus OnTouchEvent(TouchEvent* event) OVERRIDE { | 94 virtual EventResult OnTouchEvent(TouchEvent* event) OVERRIDE { |
| 95 ReceivedEvent(event); | 95 ReceivedEvent(event); |
| 96 return ui::TOUCH_STATUS_UNKNOWN; | 96 return event_result_; |
| 97 } | 97 } |
| 98 | 98 |
| 99 virtual EventResult OnGestureEvent(GestureEvent* event) OVERRIDE { | 99 virtual EventResult OnGestureEvent(GestureEvent* event) OVERRIDE { |
| 100 ReceivedEvent(event); | 100 ReceivedEvent(event); |
| 101 return event_result_; | 101 return event_result_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 int id_; | 104 int id_; |
| 105 EventResult event_result_; | 105 EventResult event_result_; |
| 106 bool expect_pre_target_; | 106 bool expect_pre_target_; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 int result = dispatcher.ProcessEvent(&target, &mouse); | 231 int result = dispatcher.ProcessEvent(&target, &mouse); |
| 232 EXPECT_EQ(ER_UNHANDLED, result); | 232 EXPECT_EQ(ER_UNHANDLED, result); |
| 233 | 233 |
| 234 int handlers[] = { 11, 11 }; | 234 int handlers[] = { 11, 11 }; |
| 235 EXPECT_EQ( | 235 EXPECT_EQ( |
| 236 std::vector<int>(handlers, handlers + sizeof(handlers) / sizeof(int)), | 236 std::vector<int>(handlers, handlers + sizeof(handlers) / sizeof(int)), |
| 237 target.handler_list()); | 237 target.handler_list()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace ui | 240 } // namespace ui |
| OLD | NEW |