<commit_before>// 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 "ui/gfx/platform_font_pango.h"

#include <string>

#include "base/memory/ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/pango_util.h"

// Test that PlatformFontPango is able to cope with PangoFontDescriptions
// containing multiple font families.  The first family should be preferred.
TEST(PlatformFontPangoTest, FamilyList) {
  PangoFontDescription* desc =
      pango_font_description_from_string("Arial,Times New Roman, 13px");
  scoped_refptr<gfx::PlatformFontPango> font(new gfx::PlatformFontPango(desc));
  pango_font_description_free(desc);
  EXPECT_EQ("Arial", font->GetFontName());
  EXPECT_EQ(13, font->GetFontSize());

  desc = pango_font_description_from_string("Times New Roman,Arial, 15px");
  scoped_refptr<gfx::PlatformFontPango> font2(new gfx::PlatformFontPango(desc));
  pango_font_description_free(desc);
  EXPECT_EQ("Times New Roman", font2->GetFontName());
  EXPECT_EQ(15, font2->GetFontSize());
}<commit_msg>Mark PlatformFontPangoTest.FamilyList as FAILS on cros<commit_after>// 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 "ui/gfx/platform_font_pango.h"

#include <string>

#include "base/memory/ref_counted.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/pango_util.h"

// Fails on Chrome OS: http://crbug.com/124451
#if defined(OS_CHROMEOS)
#define MAYBE_FamilyList FAILS_FamilyList
#else
#define MAYBE_FamilyList FamilyList
#endif

// Test that PlatformFontPango is able to cope with PangoFontDescriptions
// containing multiple font families.  The first family should be preferred.
TEST(PlatformFontPangoTest, MAYBE_FamilyList) {
  PangoFontDescription* desc =
      pango_font_description_from_string("Arial,Times New Roman, 13px");
  scoped_refptr<gfx::PlatformFontPango> font(new gfx::PlatformFontPango(desc));
  pango_font_description_free(desc);
  EXPECT_EQ("Arial", font->GetFontName());
  EXPECT_EQ(13, font->GetFontSize());

  desc = pango_font_description_from_string("Times New Roman,Arial, 15px");
  scoped_refptr<gfx::PlatformFontPango> font2(new gfx::PlatformFontPango(desc));
  pango_font_description_free(desc);
  EXPECT_EQ("Times New Roman", font2->GetFontName());
  EXPECT_EQ(15, font2->GetFontSize());
}
{'fraction_non_alphanumeric': 0.11405940594059406, 'fraction_numerical': 0.014257425742574258, 'mean_word_length': 6.135593220338983, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2478261', 'n_tokens_mistral': 858, 'n_tokens_neox': 838, 'n_words': 198}