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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/SymbolsIteratorTest.cpp

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/fonts/SymbolsIterator.h" 5 #include "platform/fonts/SymbolsIterator.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include <string> 8 #include <string>
9 9
10 namespace blink { 10 namespace blink {
(...skipping 11 matching lines...) Expand all
22 : limit(theLimit), fontFallbackPriority(theFontFallbackPriority) {} 22 : limit(theLimit), fontFallbackPriority(theFontFallbackPriority) {}
23 }; 23 };
24 24
25 class SymbolsIteratorTest : public testing::Test { 25 class SymbolsIteratorTest : public testing::Test {
26 protected: 26 protected:
27 void CheckRuns(const Vector<TestRun>& runs) { 27 void CheckRuns(const Vector<TestRun>& runs) {
28 String text(emptyString16Bit()); 28 String text(emptyString16Bit());
29 Vector<ExpectedRun> expect; 29 Vector<ExpectedRun> expect;
30 for (auto& run : runs) { 30 for (auto& run : runs) {
31 text.append(String::fromUTF8(run.text.c_str())); 31 text.append(String::fromUTF8(run.text.c_str()));
32 expect.append(ExpectedRun(text.length(), run.fontFallbackPriority)); 32 expect.push_back(ExpectedRun(text.length(), run.fontFallbackPriority));
33 } 33 }
34 SymbolsIterator symbolsIterator(text.characters16(), text.length()); 34 SymbolsIterator symbolsIterator(text.characters16(), text.length());
35 VerifyRuns(&symbolsIterator, expect); 35 VerifyRuns(&symbolsIterator, expect);
36 } 36 }
37 37
38 void VerifyRuns(SymbolsIterator* symbolsIterator, 38 void VerifyRuns(SymbolsIterator* symbolsIterator,
39 const Vector<ExpectedRun>& expect) { 39 const Vector<ExpectedRun>& expect) {
40 unsigned limit; 40 unsigned limit;
41 FontFallbackPriority fontFallbackPriority; 41 FontFallbackPriority fontFallbackPriority;
42 unsigned long runCount = 0; 42 unsigned long runCount = 0;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 TEST_F(SymbolsIteratorTest, Arrows) { 206 TEST_F(SymbolsIteratorTest, Arrows) {
207 CHECK_RUNS({{"x→←x←↑↓→", FontFallbackPriority::Text}}); 207 CHECK_RUNS({{"x→←x←↑↓→", FontFallbackPriority::Text}});
208 } 208 }
209 209
210 TEST_F(SymbolsIteratorTest, JudgePilot) { 210 TEST_F(SymbolsIteratorTest, JudgePilot) {
211 CHECK_RUNS({{"👨‍⚖️👩‍⚖️👨🏼‍⚖️👩🏼‍⚖️", 211 CHECK_RUNS({{"👨‍⚖️👩‍⚖️👨🏼‍⚖️👩🏼‍⚖️",
212 FontFallbackPriority::EmojiEmoji}}); 212 FontFallbackPriority::EmojiEmoji}});
213 } 213 }
214 214
215 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698