OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_ |
| 6 #define UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "build/build_config.h" |
| 10 #include "ui/gfx/native_widget_types.h" |
| 11 |
| 12 #if defined(USE_AURA) |
| 13 #include "ui/aura/test/event_generator.h" |
| 14 #elif defined(OS_MACOSX) |
| 15 #include "ui/views/test/widget_event_generator_mac.h" |
| 16 #endif |
| 17 |
| 18 namespace views { |
| 19 class Widget; |
| 20 |
| 21 namespace test { |
| 22 |
| 23 #if defined(USE_AURA) |
| 24 typedef aura::test::EventGenerator PlatformEventGenerator; |
| 25 #elif defined(OS_MACOSX) |
| 26 typedef WidgetEventGeneratorMac PlatformEventGenerator; |
| 27 #endif |
| 28 |
| 29 // A cross-platform event generator that can dispatch events to a views::Widget |
| 30 // and will work correctly in a sharded non-interactive unit test. On Aura |
| 31 // builds, it is simply an aura::test::EventGenerator. On other platforms, |
| 32 // events are generated and dispatched to the native widget. |
| 33 class WidgetEventGenerator : public PlatformEventGenerator { |
| 34 public: |
| 35 explicit WidgetEventGenerator(Widget* widget); |
| 36 explicit WidgetEventGenerator(gfx::NativeView context); |
| 37 WidgetEventGenerator(gfx::NativeView context, |
| 38 Widget* window_for_initial_location); |
| 39 |
| 40 virtual ~WidgetEventGenerator(); |
| 41 |
| 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(WidgetEventGenerator); |
| 44 }; |
| 45 |
| 46 } // namespace test |
| 47 } // namespace views |
| 48 |
| 49 #endif // UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_ |
OLD | NEW |