| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 TEST_F(SymbolsIteratorTest, LatinColorEmojiTextEmoji) | 90 TEST_F(SymbolsIteratorTest, LatinColorEmojiTextEmoji) |
| 91 { | 91 { |
| 92 CHECK_RUNS({ { "a", FontFallbackPriority::Text }, | 92 CHECK_RUNS({ { "a", FontFallbackPriority::Text }, |
| 93 { "⌚", FontFallbackPriority::EmojiEmoji }, | 93 { "⌚", FontFallbackPriority::EmojiEmoji }, |
| 94 { "☎", FontFallbackPriority::EmojiText } }); | 94 { "☎", FontFallbackPriority::EmojiText } }); |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_F(SymbolsIteratorTest, IgnoreVSInMath) | 97 TEST_F(SymbolsIteratorTest, IgnoreVSInMath) |
| 98 { | 98 { |
| 99 CHECK_RUNS({ { "⊆⊇⊈\xEF\xB8\x8E⊙⊚⊚", FontFallbackPriority::Math } }); | 99 CHECK_RUNS({ { "⊆⊇⊈\xEF\xB8\x8E⊙⊚⊚", FontFallbackPriority::Text } }); |
| 100 } | 100 } |
| 101 | 101 |
| 102 TEST_F(SymbolsIteratorTest, IgnoreVS15InText) | 102 TEST_F(SymbolsIteratorTest, IgnoreVS15InText) |
| 103 { | 103 { |
| 104 CHECK_RUNS({ { "abcdef\xEF\xB8\x8Eghji", FontFallbackPriority::Text } }); | 104 CHECK_RUNS({ { "abcdef\xEF\xB8\x8Eghji", FontFallbackPriority::Text } }); |
| 105 } | 105 } |
| 106 | 106 |
| 107 TEST_F(SymbolsIteratorTest, IgnoreVS16InText) | 107 TEST_F(SymbolsIteratorTest, IgnoreVS16InText) |
| 108 { | 108 { |
| 109 CHECK_RUNS({ { "abcdef\xEF\xB8\x8Fghji", FontFallbackPriority::Text } }); | 109 CHECK_RUNS({ { "abcdef\xEF\xB8\x8Fghji", FontFallbackPriority::Text } }); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 122 { "0⃣1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣*⃣", FontFallbackPriority::EmojiEmoji }, | 122 { "0⃣1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣*⃣", FontFallbackPriority::EmojiEmoji }, |
| 123 { "0123456789#*", FontFallbackPriority::Text } }); | 123 { "0123456789#*", FontFallbackPriority::Text } }); |
| 124 } | 124 } |
| 125 | 125 |
| 126 | 126 |
| 127 TEST_F(SymbolsIteratorTest, SingleFlag) | 127 TEST_F(SymbolsIteratorTest, SingleFlag) |
| 128 { | 128 { |
| 129 CHECK_RUNS({ { "🇺", FontFallbackPriority::Text } }); | 129 CHECK_RUNS({ { "🇺", FontFallbackPriority::Text } }); |
| 130 } | 130 } |
| 131 | 131 |
| 132 TEST_F(SymbolsIteratorTest, CombiningCircle) |
| 133 { |
| 134 CHECK_RUNS({ { "◌́◌̀◌̈◌̂◌̄◌̊", FontFallbackPriority::Text } }); |
| 135 } |
| 136 |
| 132 // TODO: Perhaps check for invalid country indicator combinations? | 137 // TODO: Perhaps check for invalid country indicator combinations? |
| 133 | 138 |
| 134 TEST_F(SymbolsIteratorTest, FlagsVsNonFlags) | 139 TEST_F(SymbolsIteratorTest, FlagsVsNonFlags) |
| 135 { | 140 { |
| 136 CHECK_RUNS({ { "🇺🇸🇸", FontFallbackPriority::EmojiEmoji }, // "US" | 141 CHECK_RUNS({ { "🇺🇸🇸", FontFallbackPriority::EmojiEmoji }, // "US" |
| 137 { "abc", FontFallbackPriority::Text }, | 142 { "abc", FontFallbackPriority::Text }, |
| 138 { "🇺🇸", FontFallbackPriority::EmojiEmoji }, | 143 { "🇺🇸", FontFallbackPriority::EmojiEmoji }, |
| 139 { "a🇿", FontFallbackPriority::Text } }); | 144 { "a🇿", FontFallbackPriority::Text } }); |
| 140 } | 145 } |
| 141 | 146 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 { | 209 { |
| 205 CHECK_RUNS({ { "\xE2\x80\x8D", FontFallbackPriority::Text }, | 210 CHECK_RUNS({ { "\xE2\x80\x8D", FontFallbackPriority::Text }, |
| 206 { "\xF0\x9F\x91\xA9\xE2\x80\x8D\xE2" | 211 { "\xF0\x9F\x91\xA9\xE2\x80\x8D\xE2" |
| 207 "\x9D\xA4\xEF\xB8\x8F\xE2\x80\x8D" | 212 "\x9D\xA4\xEF\xB8\x8F\xE2\x80\x8D" |
| 208 "\xF0\x9F\x92\x8B\xE2\x80\x8D\xF0\x9F\x91\xA8", | 213 "\xF0\x9F\x92\x8B\xE2\x80\x8D\xF0\x9F\x91\xA8", |
| 209 FontFallbackPriority::EmojiEmoji } }); | 214 FontFallbackPriority::EmojiEmoji } }); |
| 210 } | 215 } |
| 211 | 216 |
| 212 TEST_F(SymbolsIteratorTest, Arrows) | 217 TEST_F(SymbolsIteratorTest, Arrows) |
| 213 { | 218 { |
| 214 CHECK_RUNS({ { "x", FontFallbackPriority::Text }, | 219 CHECK_RUNS({ { "x→←x←↑↓→", FontFallbackPriority::Text } }); |
| 215 { "→←", FontFallbackPriority::Math }, | |
| 216 { "x", FontFallbackPriority::Text }, | |
| 217 { "←↑↓→", FontFallbackPriority::Math } }); | |
| 218 } | 220 } |
| 219 | 221 |
| 220 } // namespace blink | 222 } // namespace blink |
| OLD | NEW |