Flutter Engine
string_conversion_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 
5 #include "flutter/shell/platform/windows/string_conversion.h"
6 
7 #include "gtest/gtest.h"
8 
9 namespace flutter {
10 namespace testing {
11 
12 TEST(StringConversion, Utf16FromUtf8Empty) {
13  EXPECT_EQ(Utf16FromUtf8(""), L"");
14 }
15 
16 TEST(StringConversion, Utf16FromUtf8Ascii) {
17  EXPECT_EQ(Utf16FromUtf8("abc123"), L"abc123");
18 }
19 
20 TEST(StringConversion, Utf16FromUtf8Unicode) {
21  EXPECT_EQ(Utf16FromUtf8("\xe2\x98\x83"), L"\x2603");
22 }
23 
24 TEST(StringConversion, Utf8FromUtf16Empty) {
25  EXPECT_EQ(Utf8FromUtf16(L""), "");
26 }
27 
28 TEST(StringConversion, Utf8FromUtf16Ascii) {
29  EXPECT_EQ(Utf8FromUtf16(L"abc123"), "abc123");
30 }
31 
32 TEST(StringConversion, Utf8FromUtf16Unicode) {
33  EXPECT_EQ(Utf8FromUtf16(L"\x2603"), "\xe2\x98\x83");
34 }
35 
36 } // namespace testing
37 } // namespace flutter
std::string Utf8FromUtf16(const std::wstring &utf16_string)
std::wstring Utf16FromUtf8(const std::string &utf8_string)
TEST(EmbeddedViewParams, GetBoundingRectAfterMutationsWithNoMutations)