| OLD | NEW |
| 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/FontDescription.h" | 7 #include "platform/fonts/FontDescription.h" |
| 8 #include "platform/fonts/SimpleFontData.h" | 8 #include "platform/fonts/SimpleFontData.h" |
| 9 #include "platform/testing/TestingPlatformSupport.h" | 9 #include "platform/testing/TestingPlatformSupport.h" |
| 10 #include "public/platform/Platform.h" | 10 #include "public/platform/Platform.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 FontDescription fontDescription; | 28 FontDescription fontDescription; |
| 29 fontDescription.setGenericFamily(FontDescription::StandardFamily); | 29 fontDescription.setGenericFamily(FontDescription::StandardFamily); |
| 30 RefPtr<SimpleFontData> fontData = fontCache->getLastResortFallbackFont(fontD
escription, Retain); | 30 RefPtr<SimpleFontData> fontData = fontCache->getLastResortFallbackFont(fontD
escription, Retain); |
| 31 EXPECT_TRUE(fontData); | 31 EXPECT_TRUE(fontData); |
| 32 | 32 |
| 33 fontDescription.setGenericFamily(FontDescription::SansSerifFamily); | 33 fontDescription.setGenericFamily(FontDescription::SansSerifFamily); |
| 34 fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain); | 34 fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain); |
| 35 EXPECT_TRUE(fontData); | 35 EXPECT_TRUE(fontData); |
| 36 } | 36 } |
| 37 | 37 |
| 38 TEST(FontCache, availablePriorityFallbackFonts) |
| 39 { |
| 40 FontCache* fontCache = FontCache::fontCache(); |
| 41 ASSERT_TRUE(fontCache); |
| 42 |
| 43 EmptyPlatform platform; |
| 44 |
| 45 FontDescription fontDescription; |
| 46 fontDescription.setGenericFamily(FontDescription::StandardFamily); |
| 47 |
| 48 for (FontFallbackPriority fallbackPriority : |
| 49 { FontFallbackPriority::Symbols, |
| 50 FontFallbackPriority::Math, |
| 51 FontFallbackPriority::EmojiText, |
| 52 FontFallbackPriority::EmojiEmoji }) { |
| 53 |
| 54 const Vector<AtomicString> availableFallbackPriorityFonts = |
| 55 fontCache->fontListForFallbackPriority(fontDescription, |
| 56 fallbackPriority); |
| 57 EXPECT_GE(availableFallbackPriorityFonts.size(), 1u); |
| 58 } |
| 59 } |
| 60 |
| 38 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |