| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/linux/unicode_to_keysym.h" | 5 #include "remoting/host/linux/unicode_to_keysym.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 // Characters with 3 distinct keysyms. | 31 // Characters with 3 distinct keysyms. |
| 32 { 0x0030, { 0x0030, 0xffb0, 0x01000030, 0 } }, | 32 { 0x0030, { 0x0030, 0xffb0, 0x01000030, 0 } }, |
| 33 { 0x005f, { 0x005f, 0x0bc6, 0x0100005f, 0 } }, | 33 { 0x005f, { 0x005f, 0x0bc6, 0x0100005f, 0 } }, |
| 34 | 34 |
| 35 // Characters for which there are no regular keysyms. | 35 // Characters for which there are no regular keysyms. |
| 36 { 0x4444, { 0x01004444, 0 } }, | 36 { 0x4444, { 0x01004444, 0 } }, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 for (size_t i = 0; i < arraysize(kTests); ++i) { | 39 for (size_t i = 0; i < arraysize(kTests); ++i) { |
| 40 std::vector<uint32_t> keysyms; | 40 std::vector<uint32_t> keysyms = GetKeySymsForUnicode(kTests[i].code_point); |
| 41 GetKeySymsForUnicode(kTests[i].code_point, &keysyms); | |
| 42 | 41 |
| 43 std::vector<uint32_t> expected( | 42 std::vector<uint32_t> expected( |
| 44 kTests[i].expected_keysyms, | 43 kTests[i].expected_keysyms, |
| 45 std::find( | 44 std::find( |
| 46 kTests[i].expected_keysyms, kTests[i].expected_keysyms + 4, 0)); | 45 kTests[i].expected_keysyms, kTests[i].expected_keysyms + 4, 0)); |
| 47 EXPECT_EQ(expected, keysyms); | 46 EXPECT_EQ(expected, keysyms); |
| 48 } | 47 } |
| 49 } | 48 } |
| 50 | 49 |
| 51 } // namespace remoting | 50 } // namespace remoting |
| OLD | NEW |