OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/events/test/event_generator.h" | 5 #include "ui/events/test/event_generator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 flags_(0), | 154 flags_(0), |
155 grab_(false), | 155 grab_(false), |
156 async_(false), | 156 async_(false), |
157 targeting_application_(false) { | 157 targeting_application_(false) { |
158 Init(NULL, NULL); | 158 Init(NULL, NULL); |
159 } | 159 } |
160 | 160 |
161 EventGenerator::~EventGenerator() { | 161 EventGenerator::~EventGenerator() { |
162 pending_events_.clear(); | 162 pending_events_.clear(); |
163 delegate()->SetContext(NULL, NULL, NULL); | 163 delegate()->SetContext(NULL, NULL, NULL); |
| 164 ui::SetEventTickClockForTesting(nullptr); |
164 } | 165 } |
165 | 166 |
166 void EventGenerator::PressLeftButton() { | 167 void EventGenerator::PressLeftButton() { |
167 PressButton(ui::EF_LEFT_MOUSE_BUTTON); | 168 PressButton(ui::EF_LEFT_MOUSE_BUTTON); |
168 } | 169 } |
169 | 170 |
170 void EventGenerator::ReleaseLeftButton() { | 171 void EventGenerator::ReleaseLeftButton() { |
171 ReleaseButton(ui::EF_LEFT_MOUSE_BUTTON); | 172 ReleaseButton(ui::EF_LEFT_MOUSE_BUTTON); |
172 } | 173 } |
173 | 174 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 return default_delegate; | 729 return default_delegate; |
729 } | 730 } |
730 | 731 |
731 EventGeneratorDelegate* EventGenerator::delegate() { | 732 EventGeneratorDelegate* EventGenerator::delegate() { |
732 return const_cast<EventGeneratorDelegate*>( | 733 return const_cast<EventGeneratorDelegate*>( |
733 const_cast<const EventGenerator*>(this)->delegate()); | 734 const_cast<const EventGenerator*>(this)->delegate()); |
734 } | 735 } |
735 | 736 |
736 } // namespace test | 737 } // namespace test |
737 } // namespace ui | 738 } // namespace ui |
OLD | NEW |