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
3 // found in the LICENSE file.
5 #include "ui/events/test/test_event_handler.h"
7 #include "ui/events/event.h"
12 TestEventHandler::TestEventHandler()
15 num_scroll_events_(0),
17 num_gesture_events_(0),
19 handler_name_("unknown") {
22 TestEventHandler::~TestEventHandler() {}
24 void TestEventHandler::Reset() {
26 num_mouse_events_
= 0;
27 num_scroll_events_
= 0;
28 num_touch_events_
= 0;
29 num_gesture_events_
= 0;
32 void TestEventHandler::OnKeyEvent(KeyEvent
* event
) {
34 recorder_
->push_back(handler_name_
);
39 void TestEventHandler::OnMouseEvent(MouseEvent
* event
) {
41 recorder_
->push_back(handler_name_
);
45 void TestEventHandler::OnScrollEvent(ScrollEvent
* event
) {
47 recorder_
->push_back(handler_name_
);
51 void TestEventHandler::OnTouchEvent(TouchEvent
* event
) {
53 recorder_
->push_back(handler_name_
);
57 void TestEventHandler::OnGestureEvent(GestureEvent
* event
) {
59 recorder_
->push_back(handler_name_
);
60 num_gesture_events_
++;