| 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.setGenericFamily(FontDescription::StandardFamily); | 28 fontDescription.setGenericFamily(FontDescription::StandardFamily); |
| 29 RefPtr<SimpleFontData> fontData = | 29 RefPtr<SimpleFontData> fontData = |
| 30 fontCache->getLastResortFallbackFont(fontDescription, Retain); | 30 fontCache->getLastResortFallbackFont(fontDescription, 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, firstAvailableOrFirst) { |
| 39 EXPECT_TRUE(FontCache::firstAvailableOrFirst("").isEmpty()); |
| 40 EXPECT_TRUE(FontCache::firstAvailableOrFirst(String()).isEmpty()); |
| 41 |
| 42 EXPECT_EQ("Arial", FontCache::firstAvailableOrFirst("not exist, Arial")); |
| 43 } |
| 44 |
| 38 } // namespace blink | 45 } // namespace blink |
| OLD | NEW |