[DevTools] Remove forwarded connections counting
[chromium-blink-merge.git] / content / shell / app / blink_test_platform_support_linux.cc
blob7bf64c96cdb04d6e8f0bf17d151a07ebfb059f2e
1 // Copyright 2013 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.
5 #include "content/shell/app/blink_test_platform_support.h"
7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h"
9 #include "base/logging.h"
10 #include "base/path_service.h"
11 #include "ui/gfx/test/fontconfig_util_linux.h"
13 namespace content {
15 namespace {
17 const char* const kLocalFonts[] = {
18 "AHEM____.TTF",
19 "GardinerModBug.ttf",
20 "GardinerModCat.ttf",
23 } // namespace
25 bool CheckLayoutSystemDeps() {
26 return true;
29 bool BlinkTestPlatformInitialize() {
30 gfx::SetUpFontconfig();
32 base::FilePath base_path;
33 PathService::Get(base::DIR_MODULE, &base_path);
34 if (!gfx::LoadConfigFileIntoFontconfig(
35 base_path.Append(FILE_PATH_LITERAL("fonts.conf"))))
36 return false;
38 for (size_t i = 0; i < gfx::kNumSystemFontsForFontconfig; ++i) {
39 if (!gfx::LoadFontIntoFontconfig(
40 base::FilePath(gfx::kSystemFontsForFontconfig[i]))) {
41 return false;
44 for (size_t i = 0; i < arraysize(kLocalFonts); ++i) {
45 if (!gfx::LoadFontIntoFontconfig(base_path.Append(kLocalFonts[i])))
46 return false;
49 base::FilePath garuda_path("/usr/share/fonts/truetype/thai/Garuda.ttf");
50 if (!base::PathExists(garuda_path))
51 garuda_path = base::FilePath("/usr/share/fonts/truetype/tlwg/Garuda.ttf");
52 if (!base::PathExists(garuda_path))
53 garuda_path = base::FilePath("/usr/share/fonts/opentype/tlwg/Garuda.otf");
54 if (!gfx::LoadFontIntoFontconfig(garuda_path))
55 return false;
57 // We special case these fonts because they're only needed in a few layout
58 // tests.
59 base::FilePath lohit_path(
60 "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf");
61 if (!base::PathExists(lohit_path)) {
62 lohit_path = base::FilePath(
63 "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf");
65 gfx::LoadFontIntoFontconfig(lohit_path);
67 return true;
70 } // namespace content