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

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

Issue 331713003: RenderTextHarfBuzz: Implement font fallback for Win and Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests; add placeholder impl for Mac Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_fallback_win.h" 5 #include "ui/gfx/font_fallback_win.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace gfx { 8 namespace gfx {
9 9
10 namespace { 10 namespace {
11 11
12 // Subclass of LinkedFontsIterator for testing that allows mocking the linked 12 // Subclass of LinkedFontsIterator for testing that allows mocking the linked
13 // fonts vector. 13 // fonts vector.
14 class TestLinkedFontsIterator : public LinkedFontsIterator { 14 class TestLinkedFontsIterator : public internal::LinkedFontsIterator {
15 public: 15 public:
16 explicit TestLinkedFontsIterator(Font font) : LinkedFontsIterator(font) { 16 explicit TestLinkedFontsIterator(Font font) : LinkedFontsIterator(font) {
17 } 17 }
18 18
19 virtual ~TestLinkedFontsIterator() { 19 virtual ~TestLinkedFontsIterator() {
20 } 20 }
21 21
22 // Add a linked font to the mocked vector of linked fonts. 22 // Add a linked font to the mocked vector of linked fonts.
23 void AddLinkedFontForTesting(Font font) { 23 void AddLinkedFontForTesting(Font font) {
24 test_linked_fonts.push_back(font); 24 test_linked_fonts.push_back(font);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 EXPECT_TRUE(iterator.NextFont(&font)); 108 EXPECT_TRUE(iterator.NextFont(&font));
109 ASSERT_EQ("Tahoma", font.GetFontName()); 109 ASSERT_EQ("Tahoma", font.GetFontName());
110 110
111 EXPECT_TRUE(iterator.NextFont(&font)); 111 EXPECT_TRUE(iterator.NextFont(&font));
112 ASSERT_EQ("Times New Roman", font.GetFontName()); 112 ASSERT_EQ("Times New Roman", font.GetFontName());
113 113
114 EXPECT_FALSE(iterator.NextFont(&font)); 114 EXPECT_FALSE(iterator.NextFont(&font));
115 } 115 }
116 116
117 } // namespace gfx 117 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698