| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/font_render_params.h" | 5 #include "ui/gfx/font_render_params.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 class FontRenderParamsTest : public testing::Test { | 63 class FontRenderParamsTest : public testing::Test { |
| 64 public: | 64 public: |
| 65 FontRenderParamsTest() { | 65 FontRenderParamsTest() { |
| 66 SetUpFontconfig(); | 66 SetUpFontconfig(); |
| 67 CHECK(temp_dir_.CreateUniqueTempDir()); | 67 CHECK(temp_dir_.CreateUniqueTempDir()); |
| 68 original_font_delegate_ = LinuxFontDelegate::instance(); | 68 original_font_delegate_ = LinuxFontDelegate::instance(); |
| 69 LinuxFontDelegate::SetInstance(&test_font_delegate_); | 69 LinuxFontDelegate::SetInstance(&test_font_delegate_); |
| 70 DropFontRenderParamsCacheForTest(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 virtual ~FontRenderParamsTest() { | 73 virtual ~FontRenderParamsTest() { |
| 73 LinuxFontDelegate::SetInstance( | 74 LinuxFontDelegate::SetInstance( |
| 74 const_cast<LinuxFontDelegate*>(original_font_delegate_)); | 75 const_cast<LinuxFontDelegate*>(original_font_delegate_)); |
| 75 TearDownFontconfig(); | 76 TearDownFontconfig(); |
| 76 } | 77 } |
| 77 | 78 |
| 78 protected: | 79 protected: |
| 79 base::ScopedTempDir temp_dir_; | 80 base::ScopedTempDir temp_dir_; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 EXPECT_EQ("Verdana", suggested_family); | 352 EXPECT_EQ("Verdana", suggested_family); |
| 352 | 353 |
| 353 query.families.clear(); | 354 query.families.clear(); |
| 354 query.families.push_back("Arial"); | 355 query.families.push_back("Arial"); |
| 355 suggested_family.clear(); | 356 suggested_family.clear(); |
| 356 GetFontRenderParams(query, &suggested_family); | 357 GetFontRenderParams(query, &suggested_family); |
| 357 EXPECT_EQ("Verdana", suggested_family); | 358 EXPECT_EQ("Verdana", suggested_family); |
| 358 } | 359 } |
| 359 | 360 |
| 360 } // namespace gfx | 361 } // namespace gfx |
| OLD | NEW |