Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: remoting/host/linux/unicode_to_keysym_unittest.cc

Issue 2346643003: [Remoting Host] Handle text event characters that are not presented on the keyboard (Closed)
Patch Set: Fix Flakiness Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698