| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 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 WebCore; | 44 using namespace blink; |
| 45 using namespace blink; | 45 using namespace blink; |
| 46 | 46 |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| 49 class KeyboardTest : public testing::Test { | 49 class KeyboardTest : public testing::Test { |
| 50 public: | 50 public: |
| 51 | 51 |
| 52 // Pass a WebKeyboardEvent into the EditorClient and get back the string | 52 // Pass a WebKeyboardEvent into the EditorClient and get back the string |
| 53 // name of which editing event that key causes. | 53 // name of which editing event that key causes. |
| 54 // E.g., sending in the enter key gives back "InsertNewline". | 54 // E.g., sending in the enter key gives back "InsertNewline". |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 TEST_F(KeyboardTest, TestOSModifierV) | 162 TEST_F(KeyboardTest, TestOSModifierV) |
| 163 { | 163 { |
| 164 #if !OS(MACOSX) | 164 #if !OS(MACOSX) |
| 165 EXPECT_STREQ("Paste", interpretOSModifierKeyPress('V')); | 165 EXPECT_STREQ("Paste", interpretOSModifierKeyPress('V')); |
| 166 #endif | 166 #endif |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST_F(KeyboardTest, TestEscape) | 169 TEST_F(KeyboardTest, TestEscape) |
| 170 { | 170 { |
| 171 WebKeyboardEvent keyboardEvent; | 171 WebKeyboardEvent keyboardEvent; |
| 172 setupKeyDownEvent(&keyboardEvent, WebCore::VKEY_ESCAPE, noModifiers); | 172 setupKeyDownEvent(&keyboardEvent, blink::VKEY_ESCAPE, noModifiers); |
| 173 | 173 |
| 174 const char* result = interpretKeyEvent(keyboardEvent, | 174 const char* result = interpretKeyEvent(keyboardEvent, |
| 175 PlatformEvent::RawKeyDown); | 175 PlatformEvent::RawKeyDown); |
| 176 EXPECT_STREQ("Cancel", result); | 176 EXPECT_STREQ("Cancel", result); |
| 177 } | 177 } |
| 178 | 178 |
| 179 TEST_F(KeyboardTest, TestInsertTab) | 179 TEST_F(KeyboardTest, TestInsertTab) |
| 180 { | 180 { |
| 181 EXPECT_STREQ("InsertTab", interpretTab(noModifiers)); | 181 EXPECT_STREQ("InsertTab", interpretTab(noModifiers)); |
| 182 } | 182 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 TEST_F(KeyboardTest, TestInsertNewline4) | 209 TEST_F(KeyboardTest, TestInsertNewline4) |
| 210 { | 210 { |
| 211 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; | 211 int modifiers = WebInputEvent::AltKey | WebInputEvent::ShiftKey; |
| 212 const char* result = interpretNewLine(modifiers); | 212 const char* result = interpretNewLine(modifiers); |
| 213 EXPECT_STREQ("InsertNewline", result); | 213 EXPECT_STREQ("InsertNewline", result); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // empty namespace | 216 } // empty namespace |
| OLD | NEW |