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

Unified Diff: ui/aura/event_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 | « ui/aura/event.cc ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event_unittest.cc
diff --git a/ui/aura/event_unittest.cc b/ui/aura/event_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f1e65a1c2890fc4df5b138109e58d6b885effe07
--- /dev/null
+++ b/ui/aura/event_unittest.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 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.
+
+#include "ui/aura/event.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if defined(USE_X11)
+#include <X11/Xlib.h>
+#include "ui/base/x/x11_util.h"
+#endif
+
+namespace aura {
+namespace test {
+
+TEST(EventTest, NoNativeEvent) {
+ KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_SPACE, 0);
+ EXPECT_FALSE(keyev.HasNativeEvent());
+}
+
+TEST(EventTest, NativeEvent) {
+#if defined(OS_WIN)
+ MSG native_event = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
+ KeyEvent keyev(native_event, false);
+ EXPECT_TRUE(keyev.HasNativeEvent());
+#elif defined(USE_X11)
+ scoped_ptr<XEvent> native_event(new XEvent);
+ ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
+ ui::VKEY_A,
+ 0,
+ native_event.get());
+ KeyEvent keyev(native_event.get(), false);
+ EXPECT_TRUE(keyev.HasNativeEvent());
+#endif
+}
+
+} // namespace test
+} // namespace aura
« no previous file with comments | « ui/aura/event.cc ('k') | ui/aura/root_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698