Bug 1189125 - Allow xpcshell to use GTK (r=karlt)

This commit is contained in:
Bill McCloskey 2015-07-29 13:38:28 -07:00
Родитель d2ba8ca25d
Коммит ac32aef2fb
4 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -612,7 +612,6 @@ ContentChild::Init(MessageLoop* aIOLoop,
IPC::Channel* aChannel)
{
#ifdef MOZ_WIDGET_GTK
// sigh
gtk_init(nullptr, nullptr);
#endif

Просмотреть файл

@ -65,6 +65,8 @@ bool gfxPlatformGtk::sUseFcFontList = false;
gfxPlatformGtk::gfxPlatformGtk()
{
gtk_init(nullptr, nullptr);
sUseFcFontList = mozilla::Preferences::GetBool("gfx.font_rendering.fontconfig.fontlist.enabled");
if (!sUseFcFontList && !sFontconfigUtils) {
sFontconfigUtils = gfxFontconfigUtils::GetFontconfigUtils();

Просмотреть файл

@ -32,4 +32,8 @@ if CONFIG['_MSC_VER']:
if CONFIG['OS_ARCH'] == 'WINNT':
RCINCLUDE = 'xpcshell.rc'
CFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['TK_CFLAGS']
OS_LIBS += CONFIG['TK_LIBS']
FAIL_ON_WARNINGS = True

Просмотреть файл

@ -25,9 +25,20 @@
#include "nsWindowsWMain.cpp"
#endif
#ifdef MOZ_WIDGET_GTK
#include <gtk/gtk.h>
#endif
int
main(int argc, char** argv, char** envp)
{
#ifdef MOZ_WIDGET_GTK
// A default display may or may not be required for xpcshell tests, and so
// is not created here. Instead we set the command line args, which is a
// fairly cheap operation.
gtk_parse_args(&argc, &argv);
#endif
#ifdef XP_MACOSX
InitAutoreleasePool();
#endif