| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 #define CHECK_RUNS(...) \ | 61 #define CHECK_RUNS(...) \ |
| 62 DECLARE_RUNSVECTOR(__VA_ARGS__); \ | 62 DECLARE_RUNSVECTOR(__VA_ARGS__); \ |
| 63 CheckRuns(runs); | 63 CheckRuns(runs); |
| 64 | 64 |
| 65 TEST_F(SymbolsIteratorTest, Empty) { | 65 TEST_F(SymbolsIteratorTest, Empty) { |
| 66 String empty(g_empty_string16_bit); | 66 String empty(g_empty_string16_bit); |
| 67 SymbolsIterator symbols_iterator(empty.Characters16(), empty.length()); | 67 SymbolsIterator symbols_iterator(empty.Characters16(), empty.length()); |
| 68 unsigned limit = 0; | 68 unsigned limit = 0; |
| 69 FontFallbackPriority symbols_font = FontFallbackPriority::kInvalid; | 69 FontFallbackPriority symbols_font = FontFallbackPriority::kInvalid; |
| 70 ASSERT(!symbols_iterator.Consume(&limit, &symbols_font)); | 70 DCHECK(!symbols_iterator.Consume(&limit, &symbols_font)); |
| 71 ASSERT_EQ(limit, 0u); | 71 ASSERT_EQ(limit, 0u); |
| 72 ASSERT_EQ(symbols_font, FontFallbackPriority::kInvalid); | 72 ASSERT_EQ(symbols_font, FontFallbackPriority::kInvalid); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TEST_F(SymbolsIteratorTest, Space) { | 75 TEST_F(SymbolsIteratorTest, Space) { |
| 76 CHECK_RUNS({{" ", FontFallbackPriority::kText}}); | 76 CHECK_RUNS({{" ", FontFallbackPriority::kText}}); |
| 77 } | 77 } |
| 78 | 78 |
| 79 TEST_F(SymbolsIteratorTest, Latin) { | 79 TEST_F(SymbolsIteratorTest, Latin) { |
| 80 CHECK_RUNS({{"Aa", FontFallbackPriority::kText}}); | 80 CHECK_RUNS({{"Aa", FontFallbackPriority::kText}}); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 TEST_F(SymbolsIteratorTest, Arrows) { | 216 TEST_F(SymbolsIteratorTest, Arrows) { |
| 217 CHECK_RUNS({{"x→←x←↑↓→", FontFallbackPriority::kText}}); | 217 CHECK_RUNS({{"x→←x←↑↓→", FontFallbackPriority::kText}}); |
| 218 } | 218 } |
| 219 | 219 |
| 220 TEST_F(SymbolsIteratorTest, JudgePilot) { | 220 TEST_F(SymbolsIteratorTest, JudgePilot) { |
| 221 CHECK_RUNS({{"👨⚖️👩⚖️👨🏼⚖️👩🏼⚖️", | 221 CHECK_RUNS({{"👨⚖️👩⚖️👨🏼⚖️👩🏼⚖️", |
| 222 FontFallbackPriority::kEmojiEmoji}}); | 222 FontFallbackPriority::kEmojiEmoji}}); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |