| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_MOCK_KEYBOARD_H_ | 5 #ifndef CONTENT_TEST_MOCK_KEYBOARD_H_ |
| 6 #define CONTENT_TEST_MOCK_KEYBOARD_H_ | 6 #define CONTENT_TEST_MOCK_KEYBOARD_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 | 11 |
| 12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 13 #include "content/test/mock_keyboard_driver_win.h" | 13 #include "content/test/mock_keyboard_driver_win.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace content { |
| 17 |
| 16 // A mock keyboard interface. | 18 // A mock keyboard interface. |
| 17 // This class defines a pseudo keyboard device, which implements mappings from | 19 // This class defines a pseudo keyboard device, which implements mappings from |
| 18 // a tuple (layout, key code, modifiers) to Unicode characters so that | 20 // a tuple (layout, key code, modifiers) to Unicode characters so that |
| 19 // engineers can write RenderViewTest cases without taking care of such | 21 // engineers can write RenderViewTest cases without taking care of such |
| 20 // mappings. (This mapping is not trivial when using non-US keyboards.) | 22 // mappings. (This mapping is not trivial when using non-US keyboards.) |
| 21 // A pseudo keyboard device consists of two parts: a platform-independent part | 23 // A pseudo keyboard device consists of two parts: a platform-independent part |
| 22 // and a platform-dependent part. This class implements the platform-independent | 24 // and a platform-dependent part. This class implements the platform-independent |
| 23 // part. The platform-dependet part is implemented in the MockKeyboardWin class. | 25 // part. The platform-dependet part is implemented in the MockKeyboardWin class. |
| 24 // This class is usually called from RenderViewTest::SendKeyEvent(). | 26 // This class is usually called from RenderViewTest::SendKeyEvent(). |
| 25 class MockKeyboard { | 27 class MockKeyboard { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Layout keyboard_layout_; | 98 Layout keyboard_layout_; |
| 97 Modifiers keyboard_modifiers_; | 99 Modifiers keyboard_modifiers_; |
| 98 | 100 |
| 99 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 100 MockKeyboardDriverWin driver_; | 102 MockKeyboardDriverWin driver_; |
| 101 #endif | 103 #endif |
| 102 | 104 |
| 103 DISALLOW_COPY_AND_ASSIGN(MockKeyboard); | 105 DISALLOW_COPY_AND_ASSIGN(MockKeyboard); |
| 104 }; | 106 }; |
| 105 | 107 |
| 108 } // namespace content |
| 109 |
| 106 #endif // CONTENT_TEST_MOCK_KEYBOARD_H_ | 110 #endif // CONTENT_TEST_MOCK_KEYBOARD_H_ |
| OLD | NEW |