Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/OrientationIteratorTest.cpp

Issue 2807913002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
59 runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); \ 59 runs.Append(kRunsArray, sizeof(kRunsArray) / sizeof(*kRunsArray)); \
60 CheckRuns(runs); 60 CheckRuns(runs);
61 61
62 TEST_F(OrientationIteratorTest, Empty) { 62 TEST_F(OrientationIteratorTest, Empty) {
63 String empty(g_empty_string16_bit); 63 String empty(g_empty_string16_bit);
64 OrientationIterator orientation_iterator(empty.Characters16(), empty.length(), 64 OrientationIterator orientation_iterator(empty.Characters16(), empty.length(),
65 FontOrientation::kVerticalMixed); 65 FontOrientation::kVerticalMixed);
66 unsigned limit = 0; 66 unsigned limit = 0;
67 OrientationIterator::RenderOrientation orientation = 67 OrientationIterator::RenderOrientation orientation =
68 OrientationIterator::kOrientationInvalid; 68 OrientationIterator::kOrientationInvalid;
69 ASSERT(!orientation_iterator.Consume(&limit, &orientation)); 69 DCHECK(!orientation_iterator.Consume(&limit, &orientation));
70 ASSERT_EQ(limit, 0u); 70 ASSERT_EQ(limit, 0u);
71 ASSERT_EQ(orientation, OrientationIterator::kOrientationInvalid); 71 ASSERT_EQ(orientation, OrientationIterator::kOrientationInvalid);
72 } 72 }
73 73
74 TEST_F(OrientationIteratorTest, OneCharLatin) { 74 TEST_F(OrientationIteratorTest, OneCharLatin) {
75 CHECK_RUNS({{"A", OrientationIterator::kOrientationRotateSideways}}); 75 CHECK_RUNS({{"A", OrientationIterator::kOrientationRotateSideways}});
76 } 76 }
77 77
78 TEST_F(OrientationIteratorTest, OneAceOfSpades) { 78 TEST_F(OrientationIteratorTest, OneAceOfSpades) {
79 CHECK_RUNS({{"πŸ‚‘", OrientationIterator::kOrientationKeep}}); 79 CHECK_RUNS({{"πŸ‚‘", OrientationIterator::kOrientationKeep}});
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 CHECK_RUNS({{"Abc", OrientationIterator::kOrientationRotateSideways}, 154 CHECK_RUNS({{"Abc", OrientationIterator::kOrientationRotateSideways},
155 {"ほへと", OrientationIterator::kOrientationKeep}, 155 {"ほへと", OrientationIterator::kOrientationKeep},
156 {"Xyz", OrientationIterator::kOrientationRotateSideways}}); 156 {"Xyz", OrientationIterator::kOrientationRotateSideways}});
157 } 157 }
158 158
159 TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) { 159 TEST_F(OrientationIteratorTest, JapaneseMahjonggMixed) {
160 CHECK_RUNS({{"γ„γ‚γ―γ«πŸ€€γ»γΈγ¨", OrientationIterator::kOrientationKeep}}); 160 CHECK_RUNS({{"γ„γ‚γ―γ«πŸ€€γ»γΈγ¨", OrientationIterator::kOrientationKeep}});
161 } 161 }
162 162
163 } // namespace blink 163 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698