Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1557)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp

Issue 2815523002: Rename Script() returning UScriptCode to GetScript() (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/fonts/FontCache.h" 5 #include "platform/fonts/FontCache.h"
6 6
7 #include "platform/fonts/SimpleFontData.h" 7 #include "platform/fonts/SimpleFontData.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 TEST(FontCacheAndroid, fallbackFontForCharacter) { 12 TEST(FontCacheAndroid, fallbackFontForCharacter) {
13 // A Latin character in the common locale system font, but not in the 13 // A Latin character in the common locale system font, but not in the
14 // Chinese locale-preferred font. 14 // Chinese locale-preferred font.
15 const UChar32 kTestChar = 228; 15 const UChar32 kTestChar = 228;
16 16
17 FontDescription font_description; 17 FontDescription font_description;
18 font_description.SetLocale(LayoutLocale::Get("zh")); 18 font_description.SetLocale(LayoutLocale::Get("zh"));
19 ASSERT_EQ(USCRIPT_SIMPLIFIED_HAN, font_description.Script()); 19 ASSERT_EQ(USCRIPT_SIMPLIFIED_HAN, font_description.GetScript());
20 font_description.SetGenericFamily(FontDescription::kStandardFamily); 20 font_description.SetGenericFamily(FontDescription::kStandardFamily);
21 21
22 FontCache* font_cache = FontCache::GetFontCache(); 22 FontCache* font_cache = FontCache::GetFontCache();
23 ASSERT_TRUE(font_cache); 23 ASSERT_TRUE(font_cache);
24 RefPtr<SimpleFontData> font_data = 24 RefPtr<SimpleFontData> font_data =
25 font_cache->FallbackFontForCharacter(font_description, kTestChar, 0); 25 font_cache->FallbackFontForCharacter(font_description, kTestChar, 0);
26 EXPECT_TRUE(font_data); 26 EXPECT_TRUE(font_data);
27 } 27 }
28 28
29 TEST(FontCacheAndroid, genericFamilyNameForScript) { 29 TEST(FontCacheAndroid, genericFamilyNameForScript) {
(...skipping 18 matching lines...) Expand all
48 // monospace. 48 // monospace.
49 EXPECT_NE(FontFamilyNames::webkit_standard, 49 EXPECT_NE(FontFamilyNames::webkit_standard,
50 FontCache::GetGenericFamilyNameForScript( 50 FontCache::GetGenericFamilyNameForScript(
51 FontFamilyNames::webkit_standard, chinese)); 51 FontFamilyNames::webkit_standard, chinese));
52 EXPECT_EQ(FontFamilyNames::webkit_monospace, 52 EXPECT_EQ(FontFamilyNames::webkit_monospace,
53 FontCache::GetGenericFamilyNameForScript( 53 FontCache::GetGenericFamilyNameForScript(
54 FontFamilyNames::webkit_monospace, chinese)); 54 FontFamilyNames::webkit_monospace, chinese));
55 } 55 }
56 56
57 } // namespace blink 57 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698