| Index: ui/views/test/widget_event_generator.h
|
| diff --git a/ui/views/test/widget_event_generator.h b/ui/views/test/widget_event_generator.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d356b13bad0d36835bff9d494e7a627a10216f8b
|
| --- /dev/null
|
| +++ b/ui/views/test/widget_event_generator.h
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_
|
| +#define UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "build/build_config.h"
|
| +#include "ui/gfx/native_widget_types.h"
|
| +
|
| +#if defined(USE_AURA)
|
| +#include "ui/aura/test/event_generator.h"
|
| +#elif defined(OS_MACOSX)
|
| +#include "ui/views/test/widget_event_generator_mac.h"
|
| +#endif
|
| +
|
| +namespace views {
|
| +class Widget;
|
| +
|
| +namespace test {
|
| +
|
| +#if defined(USE_AURA)
|
| +typedef aura::test::EventGenerator PlatformEventGenerator;
|
| +#elif defined(OS_MACOSX)
|
| +typedef WidgetEventGeneratorMac PlatformEventGenerator;
|
| +#endif
|
| +
|
| +// A cross-platform event generator that can dispatch events to a views::Widget
|
| +// and will work correctly in a sharded non-interactive unit test. On Aura
|
| +// builds, it is simply an aura::test::EventGenerator. On other platforms,
|
| +// events are generated and dispatched to the native widget.
|
| +class WidgetEventGenerator : public PlatformEventGenerator {
|
| + public:
|
| + explicit WidgetEventGenerator(Widget* widget);
|
| + explicit WidgetEventGenerator(gfx::NativeView context);
|
| + WidgetEventGenerator(gfx::NativeView context,
|
| + Widget* window_for_initial_location);
|
| +
|
| + virtual ~WidgetEventGenerator();
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(WidgetEventGenerator);
|
| +};
|
| +
|
| +} // namespace test
|
| +} // namespace views
|
| +
|
| +#endif // UI_VIEWS_TEST_WIDGET_EVENT_GENERATOR_H_
|
|
|