Commit b83f3328 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Remove kFontConfigTestingEnvironment

CL [1] propagates the FONTCONFIG_FILE environment variable to subprocesses and
thus ensures, child/utility processes receive the correct fontconfig testing
environment.  This means adding a command line switch to indicate a testing
environment for fontconfig is no longer necessary.

R=drott,thestig
BUG=849923

Change-Id: I2234802904e9f725fa0b221fd65aced4885e0023
Reviewed-on: https://chromium-review.googlesource.com/1112768
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570263}
parent 98818706
...@@ -15,12 +15,6 @@ ...@@ -15,12 +15,6 @@
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
namespace switches {
// Indicate to child processes that they should set up the FontConfig testing
// environment.
const char kFontConfigTestingEnvironment[] = "fontconfig-testing-environment";
}; // namespace switches
namespace base { namespace base {
namespace { namespace {
......
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
#ifndef BASE_TEST_FONTCONFIG_UTIL_LINUX_H_ #ifndef BASE_TEST_FONTCONFIG_UTIL_LINUX_H_
#define BASE_TEST_FONTCONFIG_UTIL_LINUX_H_ #define BASE_TEST_FONTCONFIG_UTIL_LINUX_H_
namespace switches {
extern const char kFontConfigTestingEnvironment[];
};
namespace base { namespace base {
// Initializes Fontconfig with a custom configuration suitable for tests. // Initializes Fontconfig with a custom configuration suitable for tests.
......
...@@ -411,11 +411,6 @@ void TestSuite::Initialize() { ...@@ -411,11 +411,6 @@ void TestSuite::Initialize() {
switches.erase(switches::kEnableFeatures); switches.erase(switches::kEnableFeatures);
switches.erase(switches::kDisableFeatures); switches.erase(switches::kDisableFeatures);
#if defined(OS_LINUX)
// Pass to child processes that we need the FontConfig testing environment.
switches[switches::kFontConfigTestingEnvironment] = "";
#endif
for (const auto& iter : switches) for (const auto& iter : switches)
new_command_line.AppendSwitchNative(iter.first, iter.second); new_command_line.AppendSwitchNative(iter.first, iter.second);
......
...@@ -19,7 +19,6 @@ source_set("lib") { ...@@ -19,7 +19,6 @@ source_set("lib") {
deps = [ deps = [
"//base", "//base",
"//base/test:fontconfig_util_linux",
"//components/services/font/public/interfaces", "//components/services/font/public/interfaces",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
"//mojo/public/cpp/system", "//mojo/public/cpp/system",
...@@ -85,7 +84,6 @@ service_test("font_service_unittests") { ...@@ -85,7 +84,6 @@ service_test("font_service_unittests") {
deps = [ deps = [
"//base", "//base",
"//base/test:fontconfig_util_linux",
"//components/services/font/public/cpp", "//components/services/font/public/cpp",
"//components/services/font/public/interfaces", "//components/services/font/public/interfaces",
"//mojo/public/cpp/bindings", "//mojo/public/cpp/bindings",
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <utility> #include <utility>
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/fontconfig_util_linux.h"
#include "components/services/font/public/interfaces/constants.mojom.h" #include "components/services/font/public/interfaces/constants.mojom.h"
#include "components/services/font/public/interfaces/font_service.mojom.h" #include "components/services/font/public/interfaces/font_service.mojom.h"
#include "ppapi/buildflags/buildflags.h" #include "ppapi/buildflags/buildflags.h"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file.h" #include "base/files/file.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/test/fontconfig_util_linux.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "mojo/public/cpp/system/platform_handle.h" #include "mojo/public/cpp/system/platform_handle.h"
#include "ppapi/buildflags/buildflags.h" #include "ppapi/buildflags/buildflags.h"
...@@ -49,11 +48,6 @@ base::File GetFileForPath(const base::FilePath& path) { ...@@ -49,11 +48,6 @@ base::File GetFileForPath(const base::FilePath& path) {
return file; return file;
} }
bool FontConfigTestingEnvironmentEnabled() {
return base::CommandLine::ForCurrentProcess()->GetSwitches().count(
switches::kFontConfigTestingEnvironment);
}
int ConvertHinting(gfx::FontRenderParams::Hinting hinting) { int ConvertHinting(gfx::FontRenderParams::Hinting hinting) {
switch (hinting) { switch (hinting) {
case gfx::FontRenderParams::HINTING_NONE: case gfx::FontRenderParams::HINTING_NONE:
...@@ -93,21 +87,11 @@ std::unique_ptr<service_manager::Service> FontServiceApp::CreateService() { ...@@ -93,21 +87,11 @@ std::unique_ptr<service_manager::Service> FontServiceApp::CreateService() {
} }
FontServiceApp::FontServiceApp() { FontServiceApp::FontServiceApp() {
// TODO(thomasanderson) https://crbug.com/831146: Remove this once a reland of
// CL https://chromium-review.googlesource.com/c/chromium/src/+/1009071 lands,
// which propagates the FONTCONFIG_FILE environment variable to subprocesses
// and thus ensures, child/utility processes receive the correct fontconfig
// testing environment.
if (FontConfigTestingEnvironmentEnabled())
base::SetUpFontconfig();
registry_.AddInterface( registry_.AddInterface(
base::BindRepeating(&FontServiceApp::CreateSelf, base::Unretained(this))); base::BindRepeating(&FontServiceApp::CreateSelf, base::Unretained(this)));
} }
FontServiceApp::~FontServiceApp() { FontServiceApp::~FontServiceApp() {}
if (FontConfigTestingEnvironmentEnabled())
base::TearDownFontconfig();
}
void FontServiceApp::OnStart() {} void FontServiceApp::OnStart() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment