1 // Copyright 2013 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 #ifndef UI_EVENTS_TEST_EVENTS_TEST_UTILS_H_
6 #define UI_EVENTS_TEST_EVENTS_TEST_UTILS_H_
8 #include "ui/events/event.h"
9 #include "ui/events/event_dispatcher.h"
10 #include "ui/events/event_target.h"
18 explicit EventTestApi(Event* event);
19 virtual ~EventTestApi();
21 void set_time_stamp(base::TimeDelta time_stamp) {
22 event_->time_stamp_ = time_stamp;
30 DISALLOW_COPY_AND_ASSIGN(EventTestApi);
33 class LocatedEventTestApi : public EventTestApi {
35 explicit LocatedEventTestApi(LocatedEvent* located_event);
36 virtual ~LocatedEventTestApi();
38 void set_location(const gfx::Point& location) {
39 located_event_->location_ = location;
43 LocatedEventTestApi();
45 LocatedEvent* located_event_;
47 DISALLOW_COPY_AND_ASSIGN(LocatedEventTestApi);
50 class EventTargetTestApi {
52 explicit EventTargetTestApi(EventTarget* target);
54 const EventHandlerList& pre_target_handlers() {
55 return target_->pre_target_list_;
63 DISALLOW_COPY_AND_ASSIGN(EventTargetTestApi);
66 class EventSourceTestApi {
68 explicit EventSourceTestApi(EventSource* event_source);
70 EventDispatchDetails SendEventToProcessor(Event* event) WARN_UNUSED_RESULT;
75 EventSource* event_source_;
77 DISALLOW_COPY_AND_ASSIGN(EventSourceTestApi);
82 #endif // UI_EVENTS_TEST_EVENTS_TEST_UTILS_H_