summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp b/chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
new file mode 100644
index 00000000000..db0f122bedd
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/fonts/FontCache.h"
+
+#include "platform/fonts/SimpleFontData.h"
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+TEST(FontCacheAndroid, fallbackFontForCharacter)
+{
+ // A Latin character in the common locale system font, but not in the
+ // Chinese locale-preferred font.
+ const UChar32 testChar = 228;
+
+ FontDescription fontDescription;
+ fontDescription.setScript(USCRIPT_SIMPLIFIED_HAN);
+ fontDescription.setGenericFamily(FontDescription::StandardFamily);
+
+ FontCache* fontCache = FontCache::fontCache();
+ ASSERT_TRUE(fontCache);
+ RefPtr<SimpleFontData> fontData = fontCache->fallbackFontForCharacter(fontDescription, testChar, 0);
+ EXPECT_TRUE(fontData);
+}
+
+} // namespace WebCore