| 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/OrientationIterator.h" | 5 #include "platform/fonts/OrientationIterator.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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 runs.append(runsArray, sizeof(runsArray) / sizeof(*runsArray)); \ | 59 runs.append(runsArray, sizeof(runsArray) / sizeof(*runsArray)); \ |
| 60 CheckRuns(runs); | 60 CheckRuns(runs); |
| 61 | 61 |
| 62 TEST_F(OrientationIteratorTest, Empty) { | 62 TEST_F(OrientationIteratorTest, Empty) { |
| 63 String empty(emptyString16Bit); | 63 String empty(emptyString16Bit); |
| 64 OrientationIterator orientationIterator(empty.characters16(), empty.length(), | 64 OrientationIterator orientationIterator(empty.characters16(), empty.length(), |
| 65 FontOrientation::VerticalMixed); | 65 FontOrientation::VerticalMixed); |
| 66 unsigned limit = 0; | 66 unsigned limit = 0; |
| 67 OrientationIterator::RenderOrientation orientation = | 67 OrientationIterator::RenderOrientation orientation = |
| 68 OrientationIterator::OrientationInvalid; | 68 OrientationIterator::OrientationInvalid; |
| 69 ASSERT(!orientationIterator.consume(&limit, &orientation)); | 69 DCHECK(!orientationIterator.consume(&limit, &orientation)); |
| 70 ASSERT_EQ(limit, 0u); | 70 ASSERT_EQ(limit, 0u); |
| 71 ASSERT_EQ(orientation, OrientationIterator::OrientationInvalid); | 71 ASSERT_EQ(orientation, OrientationIterator::OrientationInvalid); |
| 72 } | 72 } |
| 73 | 73 |
| 74 TEST_F(OrientationIteratorTest, OneCharLatin) { | 74 TEST_F(OrientationIteratorTest, OneCharLatin) { |
| 75 CHECK_RUNS({{"A", OrientationIterator::OrientationRotateSideways}}); | 75 CHECK_RUNS({{"A", OrientationIterator::OrientationRotateSideways}}); |
| 76 } | 76 } |
| 77 | 77 |
| 78 TEST_F(OrientationIteratorTest, OneAceOfSpades) { | 78 TEST_F(OrientationIteratorTest, OneAceOfSpades) { |
| 79 CHECK_RUNS({{"π‘", OrientationIterator::OrientationKeep}}); | 79 CHECK_RUNS({{"π‘", OrientationIterator::OrientationKeep}}); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 CHECK_RUNS({{"Abc", OrientationIterator::OrientationRotateSideways}, | 154 CHECK_RUNS({{"Abc", OrientationIterator::OrientationRotateSideways}, |
| 155 {"γ»γΈγ¨", OrientationIterator::OrientationKeep}, | 155 {"γ»γΈγ¨", OrientationIterator::OrientationKeep}, |
| 156 {"Xyz", OrientationIterator::OrientationRotateSideways}}); | 156 {"Xyz", OrientationIterator::OrientationRotateSideways}}); |
| 157 } | 157 } |
| 158 | 158 |
| 159 TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) { | 159 TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) { |
| 160 CHECK_RUNS({{"γγγ―γ«π€γ»γΈγ¨", OrientationIterator::OrientationKeep}}); | 160 CHECK_RUNS({{"γγγ―γ«π€γ»γΈγ¨", OrientationIterator::OrientationKeep}}); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace blink | 163 } // namespace blink |
| OLD | NEW |