// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/shell/webkit_test_platform_support.h"

namespace content {

bool CheckLayoutSystemDeps() {
  return true;
}

bool WebKitTestPlatformInitialize() {
  return true;
}

}  // namespace

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/shell/webkit_test_platform_support.h"

#include "third_party/skia/include/ports/SkTypeface_android.h"

namespace {

// The root directory on the device to which resources will be pushed. This
// value needs to be equal to that set in chromium_android.py.
#define DEVICE_SOURCE_ROOT_DIR "/data/local/tmp/content_shell/"

// Primary font configuration file on the device for Skia.
const char kPrimaryFontConfig[] =
    DEVICE_SOURCE_ROOT_DIR "android_main_fonts.xml";

// The file on the device containing the fallback font configuration for Skia.
const char kFallbackFontConfig[] =
    DEVICE_SOURCE_ROOT_DIR "android_fallback_fonts.xml";

// The directory in which fonts will be stored on the Android device.
const char kFontDirectory[] = DEVICE_SOURCE_ROOT_DIR "fonts/";

}  // namespace

namespace content {

bool CheckLayoutSystemDeps() {
  return true;
}

bool WebKitTestPlatformInitialize() {
  // Initialize Skia with the font configuration files crafted for layout tests.
  SkUseTestFontConfigFile(
      kPrimaryFontConfig, kFallbackFontConfig, kFontDirectory);

  return true;
}

}  // namespace content

Load the correct fonts and reset hinting for Android layout tests
content_shell: Load the correct fonts and reset hinting for Android layout tests

This fixes most of the text differences in layout tests, because Android's
default serif font is much wider than the one used on Linux. Load the
right font configuration files through Skia and set up WebKit to use
normal font hinting.

BUG=232044
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/17405002

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@207536 0039d316-1c4b-4281-b951-d872f2087c98
