OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "core/editing/EditingBehavior.h" | 35 #include "core/editing/EditingBehavior.h" |
36 #include "core/editing/Editor.h" | 36 #include "core/editing/Editor.h" |
37 #include "core/events/EventTarget.h" | 37 #include "core/events/EventTarget.h" |
38 #include "core/events/KeyboardEvent.h" | 38 #include "core/events/KeyboardEvent.h" |
39 #include "core/frame/Settings.h" | 39 #include "core/frame/Settings.h" |
40 #include "platform/KeyboardCodes.h" | 40 #include "platform/KeyboardCodes.h" |
41 #include "public/web/WebInputEvent.h" | 41 #include "public/web/WebInputEvent.h" |
42 #include "web/WebInputEventConversion.h" | 42 #include "web/WebInputEventConversion.h" |
43 | 43 |
44 using namespace blink; | 44 using namespace blink; |
45 using namespace blink; | |
46 | 45 |
47 namespace { | 46 namespace { |
48 | 47 |
49 class KeyboardTest : public testing::Test { | 48 class KeyboardTest : public testing::Test { |
50 public: | 49 public: |
51 | 50 |
52 // Pass a WebKeyboardEvent into the EditorClient and get back the string | 51 // Pass a WebKeyboardEvent into the EditorClient and get back the string |
53 // name of which editing event that key causes. | 52 // name of which editing event that key causes. |
54 // E.g., sending in the enter key gives back "InsertNewline". | 53 // E.g., sending in the enter key gives back "InsertNewline". |
55 const char* interpretKeyEvent( | 54 const char* interpretKeyEvent( |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 206 } |
208 | 207 |
209 TEST_F(KeyboardTest, TestInsertNewline4) | 208 TEST_F(KeyboardTest, TestInsertNewline4) |
210 { | 209 { |
211 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; | 210 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; |
212 const char* result = interpretNewLine(modifiers); | 211 const char* result = interpretNewLine(modifiers); |
213 EXPECT_STREQ("InsertNewline", result); | 212 EXPECT_STREQ("InsertNewline", result); |
214 } | 213 } |
215 | 214 |
216 } // empty namespace | 215 } // empty namespace |
OLD | NEW |