Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: ui/wm/core/nested_accelerator_controller_unittest.cc

Issue 710553002: aura: Remove WindowTreeHost::PostNativeEvent(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/nested_accelerator_controller_unittest.cc
diff --git a/ui/wm/core/nested_accelerator_controller_unittest.cc b/ui/wm/core/nested_accelerator_controller_unittest.cc
index 968bcba31f8b44caf6cf4d1a0450bea3376a1ad9..ae8f5f5b2b80c254cbda331b4f5469307d59c7d8 100644
--- a/ui/wm/core/nested_accelerator_controller_unittest.cc
+++ b/ui/wm/core/nested_accelerator_controller_unittest.cc
@@ -24,6 +24,7 @@
#if defined(USE_X11)
#include <X11/Xlib.h>
+#include "ui/aura/test/x11_event_sender.h"
#include "ui/events/test/events_test_utils_x11.h"
#endif // USE_X11
@@ -79,18 +80,18 @@ void DispatchKeyReleaseA(aura::Window* root_window) {
// manager only checks a keyup event following a keydown event. See
// ShouldHandle() in ui/base/accelerators/accelerator_manager.cc for details.
#if defined(OS_WIN)
- MSG native_event_down = {NULL, WM_KEYDOWN, ui::VKEY_A, 0};
aura::WindowTreeHost* host = root_window->GetHost();
- host->PostNativeEvent(native_event_down);
+ HWND hwnd = host->GetAcceleratedWidget();
+ ::PostMessage(hwnd, WM_KEYDOWN, ui::VKEY_A, 0);
MSG native_event_up = {NULL, WM_KEYUP, ui::VKEY_A, 0};
- host->PostNativeEvent(native_event_up);
+ ::PostMessage(hwnd, WM_KEYUP, ui::VKEY_A, 0);
#elif defined(USE_X11)
ui::ScopedXI2Event native_event;
native_event.InitKeyEvent(ui::ET_KEY_PRESSED, ui::VKEY_A, 0);
aura::WindowTreeHost* host = root_window->GetHost();
- host->PostNativeEvent(native_event);
+ aura::test::PostEventToWindowTreeHost(*native_event, host);
native_event.InitKeyEvent(ui::ET_KEY_RELEASED, ui::VKEY_A, 0);
- host->PostNativeEvent(native_event);
+ aura::test::PostEventToWindowTreeHost(*native_event, host);
#endif
// Make sure the inner message-loop terminates after dispatching the events.
base::MessageLoop::current()->PostTask(
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698