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

Unified Diff: ui/aura_shell/shell_accelerator_controller_unittest.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 9 years 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
Index: ui/aura_shell/shell_accelerator_controller_unittest.cc
diff --git a/ui/aura_shell/shell_accelerator_controller_unittest.cc b/ui/aura_shell/shell_accelerator_controller_unittest.cc
index d82d33fdbbf2688df448c9f0d5efed4319b22024..e7933269cd0a261bc492d3125402de465ad53624 100644
--- a/ui/aura_shell/shell_accelerator_controller_unittest.cc
+++ b/ui/aura_shell/shell_accelerator_controller_unittest.cc
@@ -7,6 +7,7 @@
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
+#include "ui/aura_shell/event.h"
#include "ui/aura_shell/shell.h"
#include "ui/aura_shell/shell_accelerator_controller.h"
#include "ui/aura_shell/shell_window_ids.h"
@@ -160,15 +161,15 @@ TEST_F(ShellAcceleratorControllerTest, ProcessOnce) {
// The accelerator is processed only once.
#if defined(OS_WIN)
MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 };
- aura::KeyEvent key_event1(msg1, false);
+ TranslatedKeyEvent key_event1(msg1, false);
EXPECT_TRUE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event1));
MSG msg2 = { NULL, WM_CHAR, L'A', 0 };
- aura::KeyEvent key_event2(msg2, true);
+ TranslatedKeyEvent key_event2(msg2, true);
EXPECT_FALSE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event2));
MSG msg3 = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
- aura::KeyEvent key_event3(msg3, false);
+ TranslatedKeyEvent key_event3(msg3, false);
EXPECT_FALSE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event3));
#elif defined(USE_X11)
XEvent key_event;
@@ -176,8 +177,18 @@ TEST_F(ShellAcceleratorControllerTest, ProcessOnce) {
ui::VKEY_A,
0,
&key_event);
- EXPECT_TRUE(aura::RootWindow::GetInstance()->GetDispatcher()->Dispatch(
- &key_event));
+ TranslatedKeyEvent key_event1(&key_event, false);
+ EXPECT_TRUE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event1));
+
+ TranslatedKeyEvent key_event2(&key_event, true);
+ EXPECT_FALSE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event2));
+
+ ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
+ ui::VKEY_A,
+ 0,
+ &key_event);
+ TranslatedKeyEvent key_event3(&key_event, false);
+ EXPECT_FALSE(aura::RootWindow::GetInstance()->DispatchKeyEvent(&key_event3));
#endif
EXPECT_EQ(1, target.accelerator_pressed_count());
}

Powered by Google App Engine
This is Rietveld 408576698