#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include <unicode/unistr.h>
#include <string>
#include <tuple>
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/testing/font_test_base.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
namespace blink {
class FontCacheTest : public FontTestBase { … };
TEST_F(FontCacheTest, getLastResortFallbackFont) { … }
TEST_F(FontCacheTest, NoFallbackForPrivateUseArea) { … }
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
TEST_F(FontCacheTest, FallbackForEmojis) { … }
#endif
TEST_F(FontCacheTest, firstAvailableOrFirst) { … }
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
#define MAYBE_GetLargerThanMaxUnsignedFont …
#else
#define MAYBE_GetLargerThanMaxUnsignedFont …
#endif
TEST_F(FontCacheTest, MAYBE_GetLargerThanMaxUnsignedFont) { … }
#if !BUILDFLAG(IS_MAC)
TEST_F(FontCacheTest, systemFont) { … }
#endif
#if BUILDFLAG(IS_ANDROID)
TEST_F(FontCacheTest, Locale) {
FontCacheKey key1(FontFaceCreationParams(), 16,
0, 1.0f,
FontSizeAdjust(),
nullptr,
nullptr,
nullptr,
false);
FontCacheKey key2 = key1;
EXPECT_EQ(key1.GetHash(), key2.GetHash());
EXPECT_EQ(key1, key2);
key2.SetLocale(AtomicString("ja"));
EXPECT_NE(key1.GetHash(), key2.GetHash());
EXPECT_NE(key1, key2);
}
#endif
}