Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: ui/gfx/font_render_params_linux_unittest.cc

Issue 440773003: linux: Cache GetFontRenderParams() results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whoops, rename function calls in tests Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/font_render_params_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ClearFontRenderParamsCacheForTest();
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
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
OLDNEW
« no previous file with comments | « ui/gfx/font_render_params_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698