| Flutter Windows Embedder |

keyboard_utils_unittests.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #include "flutter/shell/platform/windows/keyboard_utils.h"
5
6 #include "gtest/gtest.h"
7
8 namespace flutter {
9 namespace testing {
10
11 TEST(KeyboardWin32CommonTest, EncodeUtf16) {
12 std::u16string result;
13
14 result = EncodeUtf16(0x24);
15 EXPECT_EQ(result.size(), 1);
16 EXPECT_EQ(result[0], 0x24);
17
18 result = EncodeUtf16(0x20AC);
19 EXPECT_EQ(result.size(), 1);
20 EXPECT_EQ(result[0], 0x20AC);
21
22 result = EncodeUtf16(0x10437);
23 EXPECT_EQ(result.size(), 2);
24 EXPECT_EQ(result[0], 0xD801);
25 EXPECT_EQ(result[1], 0xDC37);
26
27 result = EncodeUtf16(0x24B62);
28 EXPECT_EQ(result.size(), 2);
29 EXPECT_EQ(result[0], 0xD852);
30 EXPECT_EQ(result[1], 0xDF62);
31 }
32
33 } // namespace testing
34 } // namespace flutter
keyboard_utils.h
flutter::testing::TEST
TEST(AccessibilityBridgeWindows, GetParent)
Definition: accessibility_bridge_windows_unittests.cc:247
flutter
Definition: accessibility_bridge_windows.cc:11
flutter::EncodeUtf16
std::u16string EncodeUtf16(char32_t character)
Definition: keyboard_utils.cc:11