OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 TEST_F(SymbolsIteratorTest, EmojiZWSSequences) { | 134 TEST_F(SymbolsIteratorTest, EmojiZWSSequences) { |
135 CHECK_RUNS({{"๐ฉโ๐ฉโ๐งโ๐ฆ๐ฉโโค๏ธโ๐โ๐จ", | 135 CHECK_RUNS({{"๐ฉโ๐ฉโ๐งโ๐ฆ๐ฉโโค๏ธโ๐โ๐จ", |
136 FontFallbackPriority::EmojiEmoji}, | 136 FontFallbackPriority::EmojiEmoji}, |
137 {"abcd", FontFallbackPriority::Text}, | 137 {"abcd", FontFallbackPriority::Text}, |
138 {"๐ฉโ๐ฉโ", FontFallbackPriority::EmojiEmoji}, | 138 {"๐ฉโ๐ฉโ", FontFallbackPriority::EmojiEmoji}, |
139 {"efgh", FontFallbackPriority::Text}}); | 139 {"efgh", FontFallbackPriority::Text}}); |
140 } | 140 } |
141 | 141 |
142 TEST_F(SymbolsIteratorTest, AllEmojiZWSSequences) { | 142 TEST_F(SymbolsIteratorTest, AllEmojiZWSSequences) { |
| 143 // clang-format gets confused by Emojis, http://llvm.org/PR30530 |
| 144 // clang-format off |
143 CHECK_RUNS( | 145 CHECK_RUNS( |
144 {{"๐๐ฉโโค๏ธโ๐โ๐จ๐จโโค๏ธโ๐โ๐จ๐ฉโโค๏ธโ๐โ๐ฉ๐๐ฉโโค๏ธโ๐จ๐จโโค๏ธ" | 146 {{"๐๐ฉโโค๏ธโ๐โ๐จ๐จโโค๏ธโ๐โ๐จ๐ฉโโค๏ธโ๐โ๐ฉ๐๐ฉโโค๏ธโ๐จ๐จโโค" |
| 147 "๏ธ" |
145 "โ๐จ๐ฉโโค๏ธ" | 148 "โ๐จ๐ฉโโค๏ธ" |
146 "โ๐ฉ๐ช๐จโ๐ฉโ๐ฆ๐จโ๐ฉโ๐ง๐จโ๐ฉโ๐งโ๐ฆ๐จโ๐ฉโ๐ฆโ๐ฆ๐จโ๐ฉโ๐งโ๐ง๐จโ๐จโ" | 149 "โ๐ฉ๐ช๐จโ๐ฉโ๐ฆ๐จโ๐ฉโ๐ง๐จโ๐ฉโ๐งโ๐ฆ๐จโ๐ฉโ๐ฆโ๐ฆ๐จโ๐ฉโ๐งโ๐ง๐จโ๐จ" |
147 "๐ฆ๐จโ๐จโ๐ง๐จโ๐จโ๐งโ๐ฆ๐จโ๐จโ๐ฆโ๐ฆ๐จโ๐จโ๐งโ" | 150 "โ" |
| 151 "๐ฆ๐จโ๐จโ๐ง๐จโ๐จโ๐งโ๐ฆ๐จโ๐จโ๐ฆโ๐ฆ๐จโ๐จโ๐ง" |
| 152 "โ" |
148 "๐ง" | 153 "๐ง" |
149 "๐ฉโ๐ฉโ๐ฆ๐ฉโ๐ฉโ๐ง๐ฉโ๐ฉโ๐งโ๐ฆ๐ฉโ๐ฉโ๐ฆโ๐ฆ๐ฉโ๐ฉโ๐งโ๐ง๐โ" | 154 "๐ฉโ๐ฉโ๐ฆ๐ฉโ๐ฉโ๐ง๐ฉโ๐ฉโ๐งโ๐ฆ๐ฉโ๐ฉโ๐ฆโ๐ฆ๐ฉโ๐ฉโ๐งโ๐ง๐" |
| 155 "โ" |
150 "๐จ", | 156 "๐จ", |
151 FontFallbackPriority::EmojiEmoji}}); | 157 FontFallbackPriority::EmojiEmoji}}); |
| 158 // clang-format on |
152 } | 159 } |
153 | 160 |
154 TEST_F(SymbolsIteratorTest, ModifierPlusGender) { | 161 TEST_F(SymbolsIteratorTest, ModifierPlusGender) { |
155 CHECK_RUNS({{"โน๐ปโโ", FontFallbackPriority::EmojiEmoji}}); | 162 CHECK_RUNS({{"โน๐ปโโ", FontFallbackPriority::EmojiEmoji}}); |
156 } | 163 } |
157 | 164 |
158 TEST_F(SymbolsIteratorTest, TextMemberZwjSequence) { | 165 TEST_F(SymbolsIteratorTest, TextMemberZwjSequence) { |
159 CHECK_RUNS({{"๐จโโ", FontFallbackPriority::EmojiEmoji}}); | 166 CHECK_RUNS({{"๐จโโ", FontFallbackPriority::EmojiEmoji}}); |
160 } | 167 } |
161 | 168 |
(...skipping 26 matching lines...) Expand all Loading... |
188 "\x9D\xA4\xEF\xB8\x8F\xE2\x80\x8D" | 195 "\x9D\xA4\xEF\xB8\x8F\xE2\x80\x8D" |
189 "\xF0\x9F\x92\x8B\xE2\x80\x8D\xF0\x9F\x91\xA8", | 196 "\xF0\x9F\x92\x8B\xE2\x80\x8D\xF0\x9F\x91\xA8", |
190 FontFallbackPriority::EmojiEmoji}}); | 197 FontFallbackPriority::EmojiEmoji}}); |
191 } | 198 } |
192 | 199 |
193 TEST_F(SymbolsIteratorTest, Arrows) { | 200 TEST_F(SymbolsIteratorTest, Arrows) { |
194 CHECK_RUNS({{"xโโxโโโโ", FontFallbackPriority::Text}}); | 201 CHECK_RUNS({{"xโโxโโโโ", FontFallbackPriority::Text}}); |
195 } | 202 } |
196 | 203 |
197 } // namespace blink | 204 } // namespace blink |
OLD | NEW |