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

Unified Diff: ash/accelerators/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: move to ash/ime/ 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
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller_unittest.cc
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc
index 3c4b8cdcee29ab84ad1e2ba995e57b7cde509257..9ac406eee28aecb093ec85e789db2db471a8e7fc 100644
--- a/ash/accelerators/accelerator_controller_unittest.cc
+++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ash/accelerators/accelerator_controller.h"
+#include "ash/ime/event.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/test/aura_shell_test_base.h"
@@ -160,15 +161,15 @@ TEST_F(AcceleratorControllerTest, 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(AcceleratorControllerTest, 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());
}
« no previous file with comments | « no previous file | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698