| 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 #include "ui/base/ime/character_composer.h" | 5 #include "ui/base/ime/character_composer.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "third_party/gtk+/gdk/gdkkeysyms.h" | 9 #include "third_party/gtk+/gdk/gdkkeysyms.h" |
| 10 #include "ui/base/events.h" | 10 #include "ui/base/events/event_constants.h" |
| 11 #include "ui/base/glib/glib_integers.h" | 11 #include "ui/base/glib/glib_integers.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // Expects key is not filtered and no character is composed. | 17 // Expects key is not filtered and no character is composed. |
| 18 void ExpectKeyNotFiltered(CharacterComposer* character_composer, | 18 void ExpectKeyNotFiltered(CharacterComposer* character_composer, |
| 19 uint key, | 19 uint key, |
| 20 uint flags) { | 20 uint flags) { |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 GDK_KEY_dead_acute, GDK_KEY_4, GDK_KEY_2, | 434 GDK_KEY_dead_acute, GDK_KEY_4, GDK_KEY_2, |
| 435 GDK_KEY_space, 0, string16(1, 0x3042)); | 435 GDK_KEY_space, 0, string16(1, 0x3042)); |
| 436 // LATIN CAPITAL LETTER U WITH ACUTE while 'U' is pressed with Ctrl+Shift. | 436 // LATIN CAPITAL LETTER U WITH ACUTE while 'U' is pressed with Ctrl+Shift. |
| 437 ExpectKeyFiltered(&character_composer, GDK_KEY_dead_acute, 0); | 437 ExpectKeyFiltered(&character_composer, GDK_KEY_dead_acute, 0); |
| 438 EXPECT_TRUE(character_composer.FilterKeyPress( | 438 EXPECT_TRUE(character_composer.FilterKeyPress( |
| 439 GDK_KEY_U, EF_SHIFT_DOWN | EF_CONTROL_DOWN)); | 439 GDK_KEY_U, EF_SHIFT_DOWN | EF_CONTROL_DOWN)); |
| 440 EXPECT_EQ(string16(1, 0x00DA), character_composer.composed_character()); | 440 EXPECT_EQ(string16(1, 0x00DA), character_composer.composed_character()); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace ui | 443 } // namespace ui |
| OLD | NEW |