OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 | 8 |
9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
10 #include "EventTarget.h" | 10 #include "EventTarget.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 TEST_F(KeyboardTest, TestCtrlReturn) { | 100 TEST_F(KeyboardTest, TestCtrlReturn) { |
101 EXPECT_STREQ("InsertNewline", InterpretCtrlKeyPress(0xD)); | 101 EXPECT_STREQ("InsertNewline", InterpretCtrlKeyPress(0xD)); |
102 } | 102 } |
103 | 103 |
104 TEST_F(KeyboardTest, TestOSModifierZ) { | 104 TEST_F(KeyboardTest, TestOSModifierZ) { |
105 EXPECT_STREQ("Undo", InterpretOSModifierKeyPress('Z')); | 105 EXPECT_STREQ("Undo", InterpretOSModifierKeyPress('Z')); |
106 } | 106 } |
107 | 107 |
108 TEST_F(KeyboardTest, TestOSModifierY) { | 108 TEST_F(KeyboardTest, TestOSModifierY) { |
| 109 #if !defined(OS_MACOSX) |
109 EXPECT_STREQ("Redo", InterpretOSModifierKeyPress('Y')); | 110 EXPECT_STREQ("Redo", InterpretOSModifierKeyPress('Y')); |
| 111 #endif |
110 } | 112 } |
111 | 113 |
112 TEST_F(KeyboardTest, TestOSModifierA) { | 114 TEST_F(KeyboardTest, TestOSModifierA) { |
| 115 #if !defined(OS_MACOSX) |
113 EXPECT_STREQ("SelectAll", InterpretOSModifierKeyPress('A')); | 116 EXPECT_STREQ("SelectAll", InterpretOSModifierKeyPress('A')); |
| 117 #endif |
114 } | 118 } |
115 | 119 |
116 TEST_F(KeyboardTest, TestOSModifierX) { | 120 TEST_F(KeyboardTest, TestOSModifierX) { |
| 121 #if !defined(OS_MACOSX) |
117 EXPECT_STREQ("Cut", InterpretOSModifierKeyPress('X')); | 122 EXPECT_STREQ("Cut", InterpretOSModifierKeyPress('X')); |
| 123 #endif |
118 } | 124 } |
119 | 125 |
120 TEST_F(KeyboardTest, TestOSModifierC) { | 126 TEST_F(KeyboardTest, TestOSModifierC) { |
| 127 #if !defined(OS_MACOSX) |
121 EXPECT_STREQ("Copy", InterpretOSModifierKeyPress('C')); | 128 EXPECT_STREQ("Copy", InterpretOSModifierKeyPress('C')); |
| 129 #endif |
122 } | 130 } |
123 | 131 |
124 TEST_F(KeyboardTest, TestOSModifierV) { | 132 TEST_F(KeyboardTest, TestOSModifierV) { |
| 133 #if !defined(OS_MACOSX) |
125 EXPECT_STREQ("Paste", InterpretOSModifierKeyPress('V')); | 134 EXPECT_STREQ("Paste", InterpretOSModifierKeyPress('V')); |
| 135 #endif |
126 } | 136 } |
127 | 137 |
128 TEST_F(KeyboardTest, TestEscape) { | 138 TEST_F(KeyboardTest, TestEscape) { |
129 WebKeyboardEvent keyboard_event; | 139 WebKeyboardEvent keyboard_event; |
130 SetupKeyDownEvent(&keyboard_event, WebCore::VKEY_ESCAPE, kNoModifiers); | 140 SetupKeyDownEvent(&keyboard_event, WebCore::VKEY_ESCAPE, kNoModifiers); |
131 | 141 |
132 const char* result = InterpretKeyEvent(keyboard_event, | 142 const char* result = InterpretKeyEvent(keyboard_event, |
133 PlatformKeyboardEvent::RawKeyDown); | 143 PlatformKeyboardEvent::RawKeyDown); |
134 EXPECT_STREQ("Cancel", result); | 144 EXPECT_STREQ("Cancel", result); |
135 } | 145 } |
(...skipping 20 matching lines...) Expand all Loading... |
156 | 166 |
157 TEST_F(KeyboardTest, TestInsertNewline3) { | 167 TEST_F(KeyboardTest, TestInsertNewline3) { |
158 EXPECT_STREQ("InsertNewline", InterpretNewLine(WebInputEvent::AltKey)); | 168 EXPECT_STREQ("InsertNewline", InterpretNewLine(WebInputEvent::AltKey)); |
159 } | 169 } |
160 | 170 |
161 TEST_F(KeyboardTest, TestInsertNewline4) { | 171 TEST_F(KeyboardTest, TestInsertNewline4) { |
162 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; | 172 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; |
163 const char* result = InterpretNewLine(modifiers); | 173 const char* result = InterpretNewLine(modifiers); |
164 EXPECT_STREQ("InsertNewline", result); | 174 EXPECT_STREQ("InsertNewline", result); |
165 } | 175 } |
OLD | NEW |