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

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

Issue 407143005: linux: Add FontRenderParam test for failed Fontconfig match. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 CreateFontconfigEditStanza("antialias", "bool", "true") + 262 CreateFontconfigEditStanza("antialias", "bool", "true") +
263 kFontconfigMatchFooter + 263 kFontconfigMatchFooter +
264 kFontconfigFileFooter)); 264 kFontconfigFileFooter));
265 265
266 // The subpixel rendering setting from the delegate should make it through. 266 // The subpixel rendering setting from the delegate should make it through.
267 FontRenderParams params = GetCustomFontRenderParams( 267 FontRenderParams params = GetCustomFontRenderParams(
268 false, NULL, NULL, NULL, NULL, NULL); 268 false, NULL, NULL, NULL, NULL, NULL);
269 EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering); 269 EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering);
270 } 270 }
271 271
272 TEST_F(FontRenderParamsTest, NoFontconfigMatch) {
273 // Don't load a Fontconfig configuration.
274 FontRenderParams system_params;
275 system_params.antialiasing = true;
276 system_params.hinting = FontRenderParams::HINTING_MEDIUM;
277 system_params.subpixel_rendering = FontRenderParams::SUBPIXEL_RENDERING_RGB;
278 test_font_delegate_.set_params(system_params);
279
280 std::vector<std::string> families;
281 families.push_back("Arial");
282 families.push_back("Times New Roman");
283 const int pixel_size = 10;
284 std::string suggested_family;
285 FontRenderParams params = GetCustomFontRenderParams(
286 false, &families, &pixel_size, NULL, NULL, &suggested_family);
287
288 // The system params and the first requested family should be returned.
289 EXPECT_EQ(system_params.antialiasing, params.antialiasing);
290 EXPECT_EQ(system_params.hinting, params.hinting);
291 EXPECT_EQ(system_params.subpixel_rendering, params.subpixel_rendering);
292 EXPECT_EQ("Arial", suggested_family);
293 }
294
272 } // namespace gfx 295 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698