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

Side by Side Diff: webkit/tools/test_shell/keyboard_unittest.cc

Issue 8026: Remove WebKeyboardEvent::key_data because we don't actually use it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/tools/test_shell/event_sending_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #pragma warning(push, 0) 7 #pragma warning(push, 0)
8 #include "EventNames.h" 8 #include "EventNames.h"
9 #include "EventTarget.h" 9 #include "EventTarget.h"
10 #include "KeyboardEvent.h" 10 #include "KeyboardEvent.h"
(...skipping 16 matching lines...) Expand all
27 MakePlatformKeyboardEvent evt(keyboard_event); 27 MakePlatformKeyboardEvent evt(keyboard_event);
28 evt.SetKeyType(key_type); 28 evt.SetKeyType(key_type);
29 RefPtr<KeyboardEvent> keyboardEvent = KeyboardEvent::create(evt, NULL); 29 RefPtr<KeyboardEvent> keyboardEvent = KeyboardEvent::create(evt, NULL);
30 return editor_impl.interpretKeyEvent(keyboardEvent.get()); 30 return editor_impl.interpretKeyEvent(keyboardEvent.get());
31 } 31 }
32 32
33 static inline void SetupKeyDownEvent(WebKeyboardEvent& keyboard_event, 33 static inline void SetupKeyDownEvent(WebKeyboardEvent& keyboard_event,
34 char key_code, 34 char key_code,
35 int modifiers) { 35 int modifiers) {
36 keyboard_event.key_code = key_code; 36 keyboard_event.key_code = key_code;
37 keyboard_event.key_data = key_code;
38 keyboard_event.modifiers = modifiers; 37 keyboard_event.modifiers = modifiers;
39 keyboard_event.type = WebInputEvent::KEY_DOWN; 38 keyboard_event.type = WebInputEvent::KEY_DOWN;
40 } 39 }
41 40
42 static inline const char* InterpretCtrlKeyPress(char key_code) { 41 static inline const char* InterpretCtrlKeyPress(char key_code) {
43 WebKeyboardEvent keyboard_event; 42 WebKeyboardEvent keyboard_event;
44 SetupKeyDownEvent(keyboard_event, key_code, WebInputEvent::CTRL_KEY); 43 SetupKeyDownEvent(keyboard_event, key_code, WebInputEvent::CTRL_KEY);
45 44
46 return InterpretKeyEvent(keyboard_event, PlatformKeyboardEvent::RawKeyDown); 45 return InterpretKeyEvent(keyboard_event, PlatformKeyboardEvent::RawKeyDown);
47 } 46 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 121
123 TEST(KeyboardUnitTestKeyPress, TestInsertNewline3) { 122 TEST(KeyboardUnitTestKeyPress, TestInsertNewline3) {
124 EXPECT_STREQ("InsertNewline", InterpretNewLine(WebInputEvent::ALT_KEY)); 123 EXPECT_STREQ("InsertNewline", InterpretNewLine(WebInputEvent::ALT_KEY));
125 } 124 }
126 125
127 TEST(KeyboardUnitTestKeyPress, TestInsertNewline4) { 126 TEST(KeyboardUnitTestKeyPress, TestInsertNewline4) {
128 int modifiers = WebInputEvent::ALT_KEY | WebInputEvent::SHIFT_KEY; 127 int modifiers = WebInputEvent::ALT_KEY | WebInputEvent::SHIFT_KEY;
129 const char* result = InterpretNewLine(modifiers); 128 const char* result = InterpretNewLine(modifiers);
130 EXPECT_STREQ(result, "InsertNewline"); 129 EXPECT_STREQ(result, "InsertNewline");
131 } 130 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/event_sending_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698