blob: 61485aa435c0112a216af9ac8045d8d48cc38e41 [file] [log] [blame]
Dominik Röttsches8b49ef62017-11-21 20:04:231// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ui/gfx/font_fallback_linux.h"
6
7#include "base/strings/utf_string_conversions.h"
8#include "testing/gtest/include/gtest/gtest.h"
9#include "ui/gfx/font.h"
10
11namespace gfx {
12
13// If the Type 1 Symbol.pfb font is installed, it is returned as fallback font
14// for the PUA character 0xf6db. This test ensures we're not returning Type 1
15// fonts as fallback.
16TEST(FontFallbackLinuxTest, NoType1InFallbackFonts) {
17 FallbackFontData font_fallback_data =
18 GetFallbackFontForChar(0xf6db, std::string());
19 if (font_fallback_data.filename.length() >= 3u) {
20 std::string extension = font_fallback_data.filename.substr(
21 font_fallback_data.filename.length() - 3);
22 EXPECT_NE(extension, "pfb");
23 } else {
24 EXPECT_EQ(font_fallback_data.filename.length(), 0u);
25 }
26}
27
28} // namespace gfx