OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" |
9 #include "chrome/test/chromedriver/chrome/ui_events.h" | 10 #include "chrome/test/chromedriver/chrome/ui_events.h" |
10 #include "chrome/test/chromedriver/keycode_text_conversion.h" | 11 #include "chrome/test/chromedriver/keycode_text_conversion.h" |
11 #include "chrome/test/chromedriver/test_util.h" | 12 #include "chrome/test/chromedriver/test_util.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "ui/events/keycodes/keyboard_codes.h" | 14 #include "ui/events/keycodes/keyboard_codes.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 void CheckCharToKeyCode16(base::char16 character, ui::KeyboardCode key_code, | 18 void CheckCharToKeyCode16(base::char16 character, ui::KeyboardCode key_code, |
18 int modifiers) { | 19 int modifiers) { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 ASSERT_TRUE(SwitchKeyboardLayout("00000419")); // russian | 158 ASSERT_TRUE(SwitchKeyboardLayout("00000419")); // russian |
158 CheckCharToKeyCode(L'\u0438', ui::VKEY_B, 0); | 159 CheckCharToKeyCode(L'\u0438', ui::VKEY_B, 0); |
159 EXPECT_EQ(base::UTF16ToUTF8(L"\u0438"), | 160 EXPECT_EQ(base::UTF16ToUTF8(L"\u0438"), |
160 ConvertKeyCodeToTextNoError(ui::VKEY_B, 0)); | 161 ConvertKeyCodeToTextNoError(ui::VKEY_B, 0)); |
161 #elif defined(OS_MACOSX) | 162 #elif defined(OS_MACOSX) |
162 ASSERT_TRUE(SwitchKeyboardLayout("com.apple.keylayout.German")); | 163 ASSERT_TRUE(SwitchKeyboardLayout("com.apple.keylayout.German")); |
163 CheckCharToKeyCode('z', ui::VKEY_Y, 0); | 164 CheckCharToKeyCode('z', ui::VKEY_Y, 0); |
164 EXPECT_EQ("z", ConvertKeyCodeToTextNoError(ui::VKEY_Y, 0)); | 165 EXPECT_EQ("z", ConvertKeyCodeToTextNoError(ui::VKEY_Y, 0)); |
165 #endif | 166 #endif |
166 } | 167 } |
OLD | NEW |