Chromium Code Reviews| Index: ui/aura/test/ui_controls_factory_ozone.cc |
| diff --git a/ui/aura/test/ui_controls_factory_ozone.cc b/ui/aura/test/ui_controls_factory_ozone.cc |
| index 5bd96bb0ae6287228bd214ed794861bea6ac30a2..ff92cd6c6f866a99a2ff92ac47fe0edbd930deeb 100644 |
| --- a/ui/aura/test/ui_controls_factory_ozone.cc |
| +++ b/ui/aura/test/ui_controls_factory_ozone.cc |
| @@ -10,6 +10,7 @@ |
| #include "ui/aura/test/ui_controls_factory_aura.h" |
| #include "ui/aura/window_tree_host.h" |
| #include "ui/base/test/ui_controls_aura.h" |
| +#include "ui/events/test/events_test_utils.h" |
| namespace aura { |
| namespace test { |
| @@ -165,6 +166,14 @@ class UIControlsOzone : public ui_controls::UIControlsAura { |
| } |
| private: |
| + void SendEventToProcessor(ui::Event* event) { |
|
sky
2014/11/07 15:50:14
Is there a reason this needs to be a pointer? I br
sadrul
2014/11/07 17:03:15
This is mostly so the consumers can do SetHandled(
|
| + ui::EventSourceTestApi event_source_test(host_->GetEventSource()); |
| + ui::EventDispatchDetails details = |
| + event_source_test.SendEventToProcessor(event); |
| + if (details.dispatcher_destroyed) |
| + return; |
| + } |
| + |
| void PostKeyEvent(ui::EventType type, ui::KeyboardCode key_code, int flags) { |
| base::MessageLoop::current()->PostTask( |
| FROM_HERE, |
| @@ -182,7 +191,7 @@ class UIControlsOzone : public ui_controls::UIControlsAura { |
| flags |= ui::EF_FINAL; |
| ui::KeyEvent key_event(type, key_code, flags); |
| - host_->PostNativeEvent(&key_event); |
| + SendEventToProcessor(&key_event); |
| } |
| void PostMouseEvent(ui::EventType type, |
| @@ -209,7 +218,7 @@ class UIControlsOzone : public ui_controls::UIControlsAura { |
| // This hack is necessary to set the repeat count for clicks. |
| ui::MouseEvent mouse_event2(&mouse_event); |
| - host_->PostNativeEvent(&mouse_event2); |
| + SendEventToProcessor(&mouse_event2); |
| } |
| WindowTreeHost* host_; |