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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 #define MAYBE_AllShorthandKeys AllShorthandKeys | 268 #define MAYBE_AllShorthandKeys AllShorthandKeys |
269 #endif | 269 #endif |
270 | 270 |
271 TEST(KeyConverter, MAYBE_AllShorthandKeys) { | 271 TEST(KeyConverter, MAYBE_AllShorthandKeys) { |
272 KeyEventBuilder builder; | 272 KeyEventBuilder builder; |
273 std::list<KeyEvent> key_events; | 273 std::list<KeyEvent> key_events; |
274 builder.SetKeyCode(ui::VKEY_RETURN) | 274 builder.SetKeyCode(ui::VKEY_RETURN) |
275 ->SetText("\r", "\r") | 275 ->SetText("\r", "\r") |
276 ->Generate(&key_events); | 276 ->Generate(&key_events); |
277 builder.Generate(&key_events); | 277 builder.Generate(&key_events); |
278 builder.SetKeyCode(ui::VKEY_TAB)->SetText("\t", "\t")->Generate(&key_events); | 278 builder.SetKeyCode(ui::VKEY_TAB)->SetText("\t", "\t"); |
279 builder.SetKeyCode(ui::VKEY_BACK)->SetText("\b", "\b")->Generate(&key_events); | 279 #if defined(USE_AURA) || defined(OS_LINUX) |
| 280 builder.Generate(&key_events); |
| 281 #else |
| 282 key_events.push_back(builder.SetType(kRawKeyDownEventType)->Build()); |
| 283 key_events.push_back(builder.SetType(kKeyUpEventType)->Build()); |
| 284 #endif |
| 285 builder.SetKeyCode(ui::VKEY_BACK)->SetText("\b", "\b"); |
| 286 #if defined(USE_AURA) || defined(OS_LINUX) |
| 287 builder.Generate(&key_events); |
| 288 #else |
| 289 key_events.push_back(builder.SetType(kRawKeyDownEventType)->Build()); |
| 290 key_events.push_back(builder.SetType(kKeyUpEventType)->Build()); |
| 291 #endif |
280 builder.SetKeyCode(ui::VKEY_SPACE)->SetText(" ", " ")->Generate(&key_events); | 292 builder.SetKeyCode(ui::VKEY_SPACE)->SetText(" ", " ")->Generate(&key_events); |
281 CheckEventsReleaseModifiers("\n\r\n\t\b ", key_events); | 293 CheckEventsReleaseModifiers("\n\r\n\t\b ", key_events); |
282 } | 294 } |
283 | 295 |
284 #if defined(OS_LINUX) | 296 #if defined(OS_LINUX) |
285 // Fails on bots: crbug.com/174962 | 297 // Fails on bots: crbug.com/174962 |
286 #define MAYBE_AllEnglishKeyboardSymbols DISABLED_AllEnglishKeyboardSymbols | 298 #define MAYBE_AllEnglishKeyboardSymbols DISABLED_AllEnglishKeyboardSymbols |
287 #else | 299 #else |
288 #define MAYBE_AllEnglishKeyboardSymbols AllEnglishKeyboardSymbols | 300 #define MAYBE_AllEnglishKeyboardSymbols AllEnglishKeyboardSymbols |
289 #endif | 301 #endif |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 ->SetKeyCode(ui::VKEY_SHIFT) | 443 ->SetKeyCode(ui::VKEY_SHIFT) |
432 ->SetModifiers(0) | 444 ->SetModifiers(0) |
433 ->Build()); | 445 ->Build()); |
434 key_events.push_back(builder.SetKeyCode(ui::VKEY_CONTROL)->Build()); | 446 key_events.push_back(builder.SetKeyCode(ui::VKEY_CONTROL)->Build()); |
435 base::string16 keys; | 447 base::string16 keys; |
436 keys.push_back(static_cast<base::char16>(0xE008U)); | 448 keys.push_back(static_cast<base::char16>(0xE008U)); |
437 keys.push_back(static_cast<base::char16>(0xE009U)); | 449 keys.push_back(static_cast<base::char16>(0xE009U)); |
438 | 450 |
439 CheckEvents(keys, key_events, true /* release_modifiers */, 0); | 451 CheckEvents(keys, key_events, true /* release_modifiers */, 0); |
440 } | 452 } |
OLD | NEW |