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 #ifndef UI_EVENTS_TEST_EVENT_GENERATOR_H_ | 5 #ifndef UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_ | 6 #define UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // ui::test::EventGenerator is a tool that generates and dispatches events. | 84 // ui::test::EventGenerator is a tool that generates and dispatches events. |
85 // Unlike |ui_controls| package in ui/base/test, this does not use platform | 85 // Unlike |ui_controls| package in ui/base/test, this does not use platform |
86 // native message loops. Instead, it sends events to the event dispatcher | 86 // native message loops. Instead, it sends events to the event dispatcher |
87 // synchronously. | 87 // synchronously. |
88 // | 88 // |
89 // This class is not suited for the following cases: | 89 // This class is not suited for the following cases: |
90 // | 90 // |
91 // 1) If your test depends on native events (ui::Event::native_event()). | 91 // 1) If your test depends on native events (ui::Event::native_event()). |
92 // This return is empty/NULL event with EventGenerator. | 92 // This return is empty/NULL event with EventGenerator. |
93 // 2) If your test involves nested message loop, such as | 93 // 2) If your test involves nested run loop, such as |
94 // menu or drag & drop. Because this class directly | 94 // menu or drag & drop. Because this class directly |
95 // post an event to WindowEventDispatcher, this event will not be | 95 // post an event to WindowEventDispatcher, this event will not be |
96 // handled in the nested message loop. | 96 // handled in the nested run loop. |
97 // 3) Similarly, |base::MessagePumpObserver| will not be invoked. | 97 // 3) Similarly, |base::MessagePumpObserver| will not be invoked. |
98 // 4) Any other code that requires native message loops, such as | 98 // 4) Any other code that requires native message loops, such as |
99 // tests for WindowTreeHostWin/WindowTreeHostX11. | 99 // tests for WindowTreeHostWin/WindowTreeHostX11. |
100 // | 100 // |
101 // If one of these applies to your test, please use |ui_controls| | 101 // If one of these applies to your test, please use |ui_controls| |
102 // package instead. | 102 // package instead. |
103 // | 103 // |
104 // Note: The coordinates of the points in API is determined by the | 104 // Note: The coordinates of the points in API is determined by the |
105 // EventGeneratorDelegate. | 105 // EventGeneratorDelegate. |
106 class EventGenerator { | 106 class EventGenerator { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 479 |
480 std::unique_ptr<base::TickClock> tick_clock_; | 480 std::unique_ptr<base::TickClock> tick_clock_; |
481 | 481 |
482 DISALLOW_COPY_AND_ASSIGN(EventGenerator); | 482 DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
483 }; | 483 }; |
484 | 484 |
485 } // namespace test | 485 } // namespace test |
486 } // namespace ui | 486 } // namespace ui |
487 | 487 |
488 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ | 488 #endif // UI_EVENTS_TEST_EVENT_GENERATOR_H_ |
OLD | NEW |