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/SmallCapsIterator.h" | 5 #include "platform/fonts/SmallCapsIterator.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 #define CHECK_RUNS(...) \ | 60 #define CHECK_RUNS(...) \ |
61 DECLARE_RUNSVECTOR(__VA_ARGS__); \ | 61 DECLARE_RUNSVECTOR(__VA_ARGS__); \ |
62 CheckRuns(runs); | 62 CheckRuns(runs); |
63 | 63 |
64 TEST_F(SmallCapsIteratorTest, Empty) { | 64 TEST_F(SmallCapsIteratorTest, Empty) { |
65 String empty(g_empty_string16_bit); | 65 String empty(g_empty_string16_bit); |
66 SmallCapsIterator small_caps_iterator(empty.Characters16(), empty.length()); | 66 SmallCapsIterator small_caps_iterator(empty.Characters16(), empty.length()); |
67 unsigned limit = 0; | 67 unsigned limit = 0; |
68 SmallCapsIterator::SmallCapsBehavior small_caps_behavior = | 68 SmallCapsIterator::SmallCapsBehavior small_caps_behavior = |
69 SmallCapsIterator::kSmallCapsInvalid; | 69 SmallCapsIterator::kSmallCapsInvalid; |
70 ASSERT(!small_caps_iterator.Consume(&limit, &small_caps_behavior)); | 70 DCHECK(!small_caps_iterator.Consume(&limit, &small_caps_behavior)); |
71 ASSERT_EQ(limit, 0u); | 71 ASSERT_EQ(limit, 0u); |
72 ASSERT_EQ(small_caps_behavior, SmallCapsIterator::kSmallCapsInvalid); | 72 ASSERT_EQ(small_caps_behavior, SmallCapsIterator::kSmallCapsInvalid); |
73 } | 73 } |
74 | 74 |
75 TEST_F(SmallCapsIteratorTest, UppercaseA) { | 75 TEST_F(SmallCapsIteratorTest, UppercaseA) { |
76 CHECK_RUNS({{"A", SmallCapsIterator::kSmallCapsSameCase}}); | 76 CHECK_RUNS({{"A", SmallCapsIterator::kSmallCapsSameCase}}); |
77 } | 77 } |
78 | 78 |
79 TEST_F(SmallCapsIteratorTest, LowercaseA) { | 79 TEST_F(SmallCapsIteratorTest, LowercaseA) { |
80 CHECK_RUNS({{"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); | 80 CHECK_RUNS({{"a", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); |
(...skipping 26 matching lines...) Expand all Loading... |
107 TEST_F(SmallCapsIteratorTest, Armenian) { | 107 TEST_F(SmallCapsIteratorTest, Armenian) { |
108 CHECK_RUNS({{"աբգդ", SmallCapsIterator::kSmallCapsUppercaseNeeded}, | 108 CHECK_RUNS({{"աբգդ", SmallCapsIterator::kSmallCapsUppercaseNeeded}, |
109 {"ԵԶԷԸ", SmallCapsIterator::kSmallCapsSameCase}}); | 109 {"ԵԶԷԸ", SmallCapsIterator::kSmallCapsSameCase}}); |
110 } | 110 } |
111 | 111 |
112 TEST_F(SmallCapsIteratorTest, CombiningCharacterSequence) { | 112 TEST_F(SmallCapsIteratorTest, CombiningCharacterSequence) { |
113 CHECK_RUNS({{"èü", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); | 113 CHECK_RUNS({{"èü", SmallCapsIterator::kSmallCapsUppercaseNeeded}}); |
114 } | 114 } |
115 | 115 |
116 } // namespace blink | 116 } // namespace blink |
OLD | NEW |