8#include "flutter/fml/macros.h"
9#include "flutter/shell/platform/windows/system_utils.h"
10#include "flutter/shell/platform/windows/testing/mock_windows_proc_table.h"
11#include "gtest/gtest.h"
18 std::vector<LanguageInfo> languages =
21 ASSERT_GE(languages.size(), 1);
23 EXPECT_GE(languages[0].language.size(), 2);
28 EXPECT_CALL(proc_table, GetThreadPreferredUILanguages)
32 static const wchar_t lang[] =
L"en-US\0";
33 static const size_t lang_len =
sizeof(
lang) /
sizeof(
wchar_t);
34 static const int cnt = 1;
35 if (languages ==
nullptr) {
38 }
else if (*
size >= lang_len) {
39 memcpy(languages,
lang, lang_len *
sizeof(
wchar_t));
45 ASSERT_GE(languages.size(), 1);
47 EXPECT_FALSE(languages[0].
empty());
49 EXPECT_EQ(languages[0].
size(), wcslen(languages[0].c_str()));
50 EXPECT_EQ(languages[0],
L"en-US");
53TEST(SystemUtils, ParseLanguageNameGeneric) {
55 EXPECT_EQ(
info.language,
"en");
60TEST(SystemUtils, ParseLanguageNameWithRegion) {
62 EXPECT_EQ(
info.language,
"hu");
63 EXPECT_EQ(
info.region,
"HU");
67TEST(SystemUtils, ParseLanguageNameWithScript) {
69 EXPECT_EQ(
info.language,
"us");
71 EXPECT_EQ(
info.script,
"Latn");
74TEST(SystemUtils, ParseLanguageNameWithRegionAndScript) {
76 EXPECT_EQ(
info.language,
"uz");
77 EXPECT_EQ(
info.region,
"UZ");
78 EXPECT_EQ(
info.script,
"Latn");
81TEST(SystemUtils, ParseLanguageNameWithSuplementalLanguage) {
83 EXPECT_EQ(
info.language,
"en");
84 EXPECT_EQ(
info.region,
"US");
89TEST(SystemUtils, ParseLanguageNameWithThreeCharacterLanguage) {
91 EXPECT_EQ(
info.language,
"ale");
92 EXPECT_EQ(
info.region,
"ZZ");
101TEST(SystemUtils, Prefer24HourTimeHandlesEmptyFormat) {
105TEST(SystemUtils, Prefer24HourTimeHandles12Hour) {
109TEST(SystemUtils, Prefer24HourTimeHandles24Hour) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Mock for the |WindowsProcTable| base class.
EMSCRIPTEN_KEEPALIVE void empty()
FlutterSemanticsFlag flags
TEST(DisplayListComplexity, EmptyDisplayList)
std::wstring GetUserTimeFormat()
std::vector< std::wstring > GetPreferredLanguages(const WindowsProcTable &windows_proc_table)
std::vector< LanguageInfo > GetPreferredLanguageInfo()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
LanguageInfo ParseLanguageName(std::wstring language_name)
bool Prefer24HourTime(std::wstring time_format)
#define EXPECT_TRUE(handle)